From 2068c514b584522ca7807709cc78a1f8e5440f2c Mon Sep 17 00:00:00 2001 From: damienharper Date: Mon, 21 Jan 2019 10:09:14 +0100 Subject: [PATCH] Wording --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9f07e722..9ca980a1 100644 --- a/README.md +++ b/README.md @@ -246,12 +246,16 @@ services: class: App\CustomUserProvider ```` -### Disable auditing in runtime +### Disable auditing at runtime -If you have a situation where you need to disable audit logging for some specific operation (like an automated -process), you can do this by injecting the `dh_doctrine_audit.configuration` service in your class. +You can disable audit logging at runtime by calling `AuditConfiguration::disableAuditFor(string $entity)` +This will prevent the system from logging changes applied to `$entity` objects. -To disable auditing for an entity, use: +You can then re-enable audit logging at runtime by calling `AuditConfiguration::enableAuditFor(string $entity)` + +**Warning:** disabling audit logging for an entity will make its audit logs incomplete/partial (no change applied to specified entity is logged in the relevant audit table while audit logging is disabled for that entity). + +To disable auditing for an entity, you first have to inject the `dh_doctrine_audit.configuration` service in your class, then use: ````php $auditConfiguration->disableAuditFor(MyAuditedEntity1::class); @@ -263,7 +267,7 @@ To enable auditing afterwards, use: $auditConfiguration->enableAuditFor(MyAuditedEntity1::class); ```` -You can also have an entity that is not audited by default and only enable auditing when you need it. To do so, add +You can also disable audit logging for an entity by default and only enable auditing when needed. To do so, add this to your configuration file: ````yml @@ -276,6 +280,7 @@ dh_doctrine_audit: This will create the audit table for this entity, but will only save audit entries when explicitly enabled as shown above. + Usage ===== @@ -337,6 +342,7 @@ FAQ: > Check the [Custom user provider](#custom-user-provider) section. + License =======