Skip to content

About

Doctrine entity logger example

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

This example shows how to log changes, creations and deletions of Basket entity and it's related BasketItem entities to another related BasketTrack entities.

  1. Copy the Service and EventListener folders to your project. EventListener is the entrypoint. Add to your service.yaml:
services:

    # ...
    
    App\EventListener\EntityTrackListener:
        tags:
            - { name: doctrine.event_listener, event: onFlush }
  1. Create config/app/entity_track.yaml and import the folder by imports at your services.yaml:

# ...

imports:
    - { resource: 'app/' }
  1. Create your Basket and BasketItem entities which implement TrackableInterface.
  2. Create BasketTrack entity which implements TrackInterface.
  3. Edit BasketTrackHandler, BasketItemTrackHandler and TrackHandlers as you need.
  4. Use getBasketTrackTitle method of BasketTrackHandler to get track title.

About

Doctrine entity logger example

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages