Skip to content

Instantly share code, notes, and snippets.

View Nightbr's full-sized avatar
🦎

Titouan B Nightbr

🦎
View GitHub Profile
@Nightbr
Nightbr / CategoryListener.php
Last active October 6, 2021 17:20
FOSElasticaBundle: Doctrine ORM Listener with relation updates
<?php
namespace AppBundle\Listener\Search;
/**
* Automatically update ElasticSearch based on changes to the Doctrine source
* data. One listener is generated for each Doctrine entity / ElasticSearch type.
*/
class CategoryListener extends SearchListener
{
@Nightbr
Nightbr / php-fpm.conf
Created August 22, 2017 13:17
Symfony dev project php-fpm.conf for kickoff-docker-php
server {
listen 80;
server_name _;
charset utf-8;
root /var/www/html/web;
index index.php index.html index.htm;
location / {
try_files $uri @rewriteapp;
@Nightbr
Nightbr / .dockerignore
Last active March 3, 2022 12:42
FusionInvoice Docker
.tmp
.git
docker-compose.yml
Dockerfile
<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* Locale
*
* @ApiResource(
<?php
namespace App\Repository;
use App\Entity\Locale;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
final class LocaleRepository
{
<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiSubresource;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\MaxDepth;
<?php
namespace App\Entity\Translation;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation;
/**
* @ORM\Table(name="company_translations", indexes={
* @ORM\Index(name="company_translation_idx", columns={"locale", "object_class", "field", "foreign_key"})
* })
<?php
namespace App\EventListener;
use App\Entity\Locale;
use App\Repository\LocaleRepository;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
### Keybase proof
I hereby claim:
* I am nightbr on github.
* I am nightb (https://keybase.io/nightb) on keybase.
* I have a public key ASBJqhWUsWBY0ZlEbDygAuoLilzDcB45c0SWYTPwreWubAo
To claim this, I am signing this object: