Property | Type | Description | |
---|---|---|---|
$_modelOrder | A copy of the model order to restore from | ||
$_modelVirtualFields | A copy of the model virtual fields to restore from | ||
$_original | array | A copy of the object as it existed prior to the save. We're going to store this off, so we can calculate the deltas after save. | |
$_requestId | string | The requestId is a unique ID generated once per request to allow multiple record changes to be grouped by request |
Method | Description | |
---|---|---|
afterDelete ( Model $Model ) : void | Executed after a model is deleted. | |
afterSave ( Model $Model, boolean $created, array $options = [] ) : true | Executed after a save operation completes. | |
beforeDelete ( Model $Model, boolean $cascade = true ) : true | Executed before a delete operation. | |
beforeSave ( Model $Model, array $options = [] ) : true | Executed before a save operation. | |
setup ( Model $Model, array $settings = [] ) : void | Initiate behavior for the model using specified settings. |
Method | Description | |
---|---|---|
_getModelData ( Model $Model ) : array | false | Get model data | |
_isAuditLogModel ( Model $Model ) : boolean | Check if the given model is one of AuditLog ones | |
_requestId ( ) : null | string | Get request ID | |
_restoreVirtualFields ( Model $Model ) : void | Restore the virtual fields & order | |
_unsetVirtualFieldsTemporarily ( Model $Model ) : void | Preserve and unset virtual fields and order as we don't need them and since they can cause SQL errors |
protected _getModelData ( Model $Model ) : array | false | ||
$Model | Model | The model that uses the behavior. |
return | array | false | The model data or false. |
protected _isAuditLogModel ( Model $Model ) : boolean | ||
$Model | Model | The model to check |
return | boolean | True if yes, else false. |
protected _requestId ( ) : null | string | ||
return | null | string | The request ID. |
protected _restoreVirtualFields ( Model $Model ) : void | ||
$Model | Model | The model to restore the virtual fields for. |
return | void |
protected _unsetVirtualFieldsTemporarily ( Model $Model ) : void | ||
$Model | Model | The model to unset the virtual fields from. |
return | void |
public afterDelete ( Model $Model ) : void | ||
$Model | Model | The model that is used for the delete operation. |
return | void |
public beforeDelete ( Model $Model, boolean $cascade = true ) : true | ||
$Model | Model | The model using the behavior. |
$cascade | boolean | Whether to cascade (unused). |
return | true | Always true. |
public beforeSave ( Model $Model, array $options = [] ) : true | ||
$Model | Model | The model using the behavior. |
$options | array | The options data (unused). |
return | true | Always true. |
protected $_modelVirtualFields |
protected array $_original | ||
return | array |
protected static string $_requestId | ||
return | string |