Property | Type | Description | |
---|---|---|---|
$active | boolean | Is the behavior is active or not | |
$allowed | array | Array with fields to save You don't need to configure both allowed and ignored | |
$dateFormat | string | Date format to use in stamp - set to "Y-m-d H:i:s" for datetime or "U" for timestamp | |
$ignored | array | Array with fields to ignore You don't need to configure both allowed and ignored | |
$ignoredClasses | array | Array with classes to ignore | |
$override | array | Array with fields you want to override before saving the row into audit_trail table |
Method | Description | |
---|---|---|
afterDelete ( ) | ||
afterFind ( ) | ||
afterInsert ( ) | ||
afterUpdate ( ) | ||
audit ( $action ) | ||
events ( ) | ||
getOldAttributes ( ) : array | ||
setOldAttributes ( $value ) |
Method | Description | |
---|---|---|
auditAttributes ( string $action ) | ||
cleanAttributes ( $attributes ) : mixed | Clean attributes of fields that are not allowed or ignored. | |
cleanAttributesAllowed ( $attributes ) : mixed | Unset attributes which are not allowed | |
cleanAttributesIgnored ( $attributes ) : mixed | Unset attributes which are ignored | |
cleanAttributesOverride ( $attributes ) : mixed | attributes which need to get override with a new value | |
getAuditEntryId ( ) : |
||
getNormalizedPk ( ) : string | ||
getUserId ( ) : integer | null | string | ||
saveAuditTrail ( $action, $newAttributes, $oldAttributes, $entry_id, $user_id, $model, $model_id, $created ) | Save the audit trails for a create or update action | |
saveAuditTrailDelete ( ) | Save the audit trails for a delete action |
Method | Description | |
---|---|---|
getNewOverrideValues ( string $searchFieldValue, string $queryParams ) : mixed |
protected cleanAttributes ( $attributes ) : mixed | ||
$attributes | ||
return | mixed |
protected cleanAttributesAllowed ( $attributes ) : mixed | ||
$attributes | ||
return | mixed |
protected cleanAttributesIgnored ( $attributes ) : mixed | ||
$attributes | ||
return | mixed |
protected cleanAttributesOverride ( $attributes ) : mixed | ||
$attributes | ||
return | mixed |
protected getAuditEntryId ( ) : |
||
return |
protected saveAuditTrail ( $action, $newAttributes, $oldAttributes, $entry_id, $user_id, $model, $model_id, $created ) | ||
$action | ||
$newAttributes | ||
$oldAttributes | ||
$entry_id | ||
$user_id | ||
$model | ||
$model_id | ||
$created |
protected saveAuditTrailDelete ( ) |
public array $allowed | ||
return | array |
public string $dateFormat | ||
return | string |
public array $ignored | ||
return | array |
public array $ignoredClasses | ||
return | array |
public array $override | ||
return | array |