AuditableBehavior

Extends \ModelBehavior

Records changes made to an object during save operations.

package

AuditLog

subpackage

Model.Behavior

Methods

Method checks if model need to save activity

_auditHasToSave(string $permissionName, \Model $Model) : boolean

Arguments

$permissionName

string

$Model

\Model

Response

boolean

_calledFunctionNeedAudit

_calledFunctionNeedAudit(\Model $Model) : boolean

Arguments

$Model

\Model

Response

boolean

function _getModelData Retrieves the entire set model data contained to the primary object and any/all HABTM associated data that has been configured with the behavior.

_getModelData(\Model $Model) : array

Additionally, for the HABTM data, all we care about is the IDs, so the data will be reduced to an indexed array of those IDs.

Arguments

$Model

\Model

Response

array

{@inheritdoc}

afterDelete(\Model $Model) 

Arguments

$Model

\Model

{@inheritdoc}

afterFind(\Model $Model, mixed $results, boolean $primary = false) 

Arguments

$Model

\Model

$results

mixed

$primary

boolean

{@inheritdoc}

afterSave(\Model $Model, boolean $created, array $options = array()) : boolean

Arguments

$Model

\Model

$created

boolean

$options

array

Response

boolean

{@inheritdoc}

beforeDelete(\Model $Model, boolean $cascade = true) : boolean

Arguments

$Model

\Model

$cascade

boolean

Response

boolean

{@inheritdoc}

beforeSave(\Model $Model, array $options = array()) : boolean

Arguments

$Model

\Model

$options

array

Response

boolean

Initiate behavior for the model using specified settings.

setup(\Model $Model, array $settings = array()) 

Available settings:

  • ignore array, optional An array of property names to be ignored when records are created in the deltas table.
  • habtm array, optional An array of models that have a HABTM relationship with the acting model and whose changes should be monitored with the model.

Arguments

$Model

\Model

Model using the behavior

$settings

array

Settings overrides.

Properties

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.

_original : array
var

Type(s)

array