audit.rst 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Audit
  2. =====
  3. The bundle provides a support for the ``EntityAuditBundle`` from https://github.com/simplethings/EntityAudit.
  4. How it works
  5. ------------
  6. **Extract from the original documentation**
  7. There are a bunch of different approaches to auditing or versioning of database tables. This extension creates a
  8. mirroring table for each audited entities table that is suffixed with "_audit". Besides all the columns of the
  9. audited entity there are two additional fields:
  10. - rev : Contains the global revision number generated from a "revisions" table.
  11. - revtype : Contains one of 'INS', 'UPD' or 'DEL' as an information to which type of database operation caused
  12. this revision log entry.
  13. The global revision table contains an id, timestamp, username and change comment field.
  14. With this approach it is possible to version an application with its changes to associations at the particular
  15. points in time.
  16. This extension hooks into the SchemaTool generation process so that it will automatically create the necessary
  17. DDL statements for your audited entities.
  18. Configuration
  19. -------------
  20. If the ``EntityAuditBundle`` is enabled, then all entities managed by the ``DoctrineORMAdminBundle`` will be autited.
  21. Usage
  22. -----
  23. Once the ``EntityAuditBundle`` is set, then 2 new actions are availables :
  24. - /admin/vendor/entity/{id}/history : display the history list
  25. - /admin/vendor/entity/{id}/history/{revision} : display the object at a specific revision
  26. These actions are available in the ``view`` and ``edit`` action. Please note the current implementation uses
  27. the ``show`` definition to display the revision.