AuditableTrait
trait AuditableTrait
Trait Auditable to be used in Models
Assumes presence of these members
Properties
static protected bool | $auditingDisabled | Is auditing disabled? |
|
protected | $auditExcludedProperties | ||
Controller read-only | $mod | ||
array read-only | $properties | ||
string read-only | $table_name |
Methods
No description
Get audit events
Get the (Auditable) properties excluded from audit.
Get the auditable properties to include in audit Defaults to all attributes in the DB Schema
Get the last auditTrail records for current Model
Init Method
Determine whether auditing is enabled.
TBD: Move this method to the audit model? and keep things slim in trait?
Details
at line 97
AuditTrail|null
addAuditTrail(string $event = AuditableInterface::AUDIT_EVENT_MISC, string|null $customMessage = null)
No description
at line 166
array
getAuditEvents()
Get audit events
at line 220
array
getAuditExcludeProperties()
Get the (Auditable) properties excluded from audit.
Defaults to primary_key and timestamps
at line 199
array
getAuditIncludeProperties()
Get the auditable properties to include in audit Defaults to all attributes in the DB Schema
at line 183
AuditTrail[]|ModelCollection
getAuditTrail(int $limit = 50)
Get the last auditTrail records for current Model
at line 43
initAuditableTrait()
Init Method
at line 233
bool
isAuditingEnabled()
Determine whether auditing is enabled.
Defaults to true for Frontend/UI Actions and false for CLI/Console Actions
at line 59
triggerAuditEvent(Model $model, string $eventKey = AuditableInterface::OBSERVE_EVENT_SAVE)
TBD: Move this method to the audit model? and keep things slim in trait?