Public Member Functions | Protected Attributes

CallbackBehavior Class Reference

Migration behavior to translate basic Cake callbacks to BeCallbackManager events. More...

List of all members.

Public Member Functions

 setup (Model &$model, array $config=array())
 Setup callback behavior.
 cleanup (Model &$model)
 Detach callback behavior.
 beforeFind (Model &$model, array $query)
 Migration helper for event `beforeFind`.
 afterFind (Model &$model, $results, $primary)
 Migration helper for event `afterFind`.
 beforeValidate (Model &$model)
 Migration helper for event `beforeValidate`.
 beforeSave (Model &$model)
 Migration helper for event `beforeSave`.
 afterSave (Model &$model, $created)
 Migration helper for event `afterSave`.
 beforeDelete (Model &$model, $cascade=true)
 Migration helper for event `beforeDelete`.
 afterDelete (Model &$model)
 Migration helper for event `afterDelete`.

Protected Attributes

 $config = array()

Detailed Description

Migration behavior to translate basic Cake callbacks to BeCallbackManager events.

When this behavior is attached to a model `MyModel`, all enabled behaviors with a name like `MyModelSomethingCallbackBehavior` (where `Something` can be replaced with anything you want) will be automatically attached to `MyModel`'s events.

You can also attach a callback behavior to *all* object type using the `BEObject` reserved name: for instance, you might create a `BEObjectSomethingCallbackBehavior` to attach callback operations to every core and plugin object type at once.

If this behavior is attached with configuration key `callbackManager` explicitely set to false, callbacks behaviors will be attached using CakePHP's built in associations. Otherwise, public callback behaviors' methods will be treated as listeners for corresponding events, thus allowing finer control on event propagation and details, as well as detachment of single methods within a behavior.

See also:
BeCallbackManager

Definition at line 41 of file callback.php.


Member Function Documentation

CallbackBehavior::afterDelete ( Model &$  model  ) 

Migration helper for event `afterDelete`.

Parameters:
Model $model Model.
Returns:
mixed Result. public

Definition at line 299 of file callback.php.

CallbackBehavior::afterFind ( Model &$  model,
results,
primary 
)

Migration helper for event `afterFind`.

Parameters:
Model $model Model.
mixed $results Results.
bool $primary Primary.
Returns:
mixed Result. public

Definition at line 223 of file callback.php.

CallbackBehavior::afterSave ( Model &$  model,
created 
)

Migration helper for event `afterSave`.

Parameters:
Model $model Model.
bool $created Created.
Returns:
mixed Result. public

Definition at line 268 of file callback.php.

CallbackBehavior::beforeDelete ( Model &$  model,
cascade = true 
)

Migration helper for event `beforeDelete`.

Parameters:
Model $model Model.
bool $cascade Cascade.
Returns:
mixed Result. public

Definition at line 284 of file callback.php.

CallbackBehavior::beforeFind ( Model &$  model,
array $  query 
)

Migration helper for event `beforeFind`.

Parameters:
Model $model Model.
array $query Query.
Returns:
mixed Result. public

Definition at line 206 of file callback.php.

CallbackBehavior::beforeSave ( Model &$  model  ) 

Migration helper for event `beforeSave`.

Parameters:
Model $model Model.
Returns:
mixed Result. public

Definition at line 253 of file callback.php.

CallbackBehavior::beforeValidate ( Model &$  model  ) 

Migration helper for event `beforeValidate`.

Parameters:
Model $model Model.
Returns:
mixed Result. public

Definition at line 239 of file callback.php.

CallbackBehavior::cleanup ( Model &$  model  ) 

Detach callback behavior.

Parameters:
Model $model Model. public

Definition at line 184 of file callback.php.

CallbackBehavior::setup ( Model &$  model,
array $  config = array() 
)

Setup callback behavior.

Parameters:
Model $model Model.
array $config Configuration. public

Definition at line 111 of file callback.php.


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus