Download the PHP package atournayre/historique-bundle without Composer
On this page you can find all versions of the php package atournayre/historique-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atournayre/historique-bundle
More information about atournayre/historique-bundle
Files in atournayre/historique-bundle
Package historique-bundle
Short Description This bundle add History management for entities.
License MIT
Informations about the package historique-bundle
History Bundle
This bundle add History management for entities.
Requirements
Symfony ^5.4
PHP ^8.1
Install
Composer
Register bundle
Configuration
Replace App\Model\History
by your History entity.
Replace App\Model\User
by your User entity.
Add History entity to your application.
Usage
- Create/Update entity
- Create a factory for the entity you want to log
- Map your entity to the factory
Create/Update entity
You can add History to existing entities or add it to new ones.
To add history to an entity, it needs to implements HistorycableInterface
.
Then use HistorycableTrait
to add a relation between YourEntity and History.
Create a factory for the entity you want to log
Factories are where magic happens.
You have to create a Factory that implements how you want to store the history.
Map your entity to the factory
Once you factory is created, you need to add a mapping to the config file, so the listener can automatically get the right factory for the right entity.
With this, you can locate entities and factories anywhere in your project.
How to get values ?
Contributing
Of course, open source is fueled by everyone's ability to give just a little bit of their time for the greater good. If you'd like to see a feature or add some of your own happy words, awesome! Tou can request it - but creating a pull request is an even better way to get things done.
Either way, please feel comfortable submitting issues or pull requests: all contributions and questions are warmly appreciated :).
All versions of historique-bundle with dependencies
symfony/config Version 5.4.*
symfony/dependency-injection Version 5.4.*
doctrine/orm Version ^2.9
symfony/security-bundle Version 5.4.*
doctrine/common Version ^3.1
symfony/serializer Version 5.4.*
symfony/yaml Version ^5.4