프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_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 |
메소드 | 설명 | |
---|---|---|
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. |
메소드 | 설명 | |
---|---|---|
_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. |
리턴 | array | false | The model data or false. |
protected _isAuditLogModel ( Model $Model ) : boolean | ||
$Model | Model | The model to check |
리턴 | boolean | True if yes, else false. |
protected _requestId ( ) : null | string | ||
리턴 | null | string | The request ID. |
protected _restoreVirtualFields ( Model $Model ) : void | ||
$Model | Model | The model to restore the virtual fields for. |
리턴 | void |
protected _unsetVirtualFieldsTemporarily ( Model $Model ) : void | ||
$Model | Model | The model to unset the virtual fields from. |
리턴 | void |
public afterDelete ( Model $Model ) : void | ||
$Model | Model | The model that is used for the delete operation. |
리턴 | void |
public beforeDelete ( Model $Model, boolean $cascade = true ) : true | ||
$Model | Model | The model using the behavior. |
$cascade | boolean | Whether to cascade (unused). |
리턴 | true | Always true. |
public beforeSave ( Model $Model, array $options = [] ) : true | ||
$Model | Model | The model using the behavior. |
$options | array | The options data (unused). |
리턴 | true | Always true. |
protected $_modelVirtualFields |
protected array $_original | ||
리턴 | array |
protected static string $_requestId | ||
리턴 | string |