basster / doctrine-elastica-loggable-extension
This library utilizes Gedmo Loggable Doctrine Extension to persist the entity changes into elasticsearch via elastica.io.
Installs: 7 647
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- doctrine/common: ^2.8
- gedmo/doctrine-extensions: ^2.4
- ruflin/elastica: ^5.2.1|^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.7
- phpunit/phpunit: ^6.4
This package is auto-updated.
Last update: 2024-12-20 22:40:51 UTC
README
This library utilizes Gedmo Loggable Doctrine Extension to persist the entity changes into elasticsearch via elastica.io.
To make it work in Symfony with Doctrine Extentions Bundle place the following config in your services.yml
:
# services.yml services: # overwrite DoctrineExtensionsBundle default listener to inject the ElasticaLoggableListener Stof\DoctrineExtensionsBundle\EventListener\LoggerListener: arguments: - '@Basster\ElasticaLoggable\Listener\ElasticaLoggableListener' - '@security.token_storage' - '@security.authorization_checker' public: true tags: - {name: kernel.event_subscriber} # register the ElasticaLoggableListener as a service in your application Basster\ElasticaLoggable\Listener\ElasticaLoggableListener: public: true arguments: ['@elastica.type.activity'] calls: - [setAnnotationReader, ['@annotation_reader']] tags: - { name: doctrine.event_subscriber, connection: default } # overwrite doctrine extension service aliases stof_doctrine_extensions.event_listener.logger: '@Basster\ElasticaLoggable\Listener\ElasticaLoggableListener' stof_doctrine_extensions.listener.loggable: '@Basster\ElasticaLoggable\Listener\ElasticaLoggableListener'