ModelBehavior Class Reference

Inheritance diagram for ModelBehavior:

Object AclBehavior ContainableBehavior TranslateBehavior TreeBehavior List of all members.

Public Member Functions

 _addToWhitelist (&$model, $field)
 afterDelete (&$model)
 afterFind (&$model, $results, $primary)
 afterSave (&$model, $created)
 beforeDelete (&$model, $cascade=true)
 beforeFind (&$model, $query)
 beforeSave (&$model)
 beforeValidate (&$model)
 cleanup (&$model)
 dispatchMethod (&$model, $method, $params=array())
 onError (&$model, $error)
 setup (&$model, $config=array())

Public Attributes

 $mapMethods = array()
 $settings = array()

Detailed Description

Definition at line 35 of file behavior.php.


Member Function Documentation

ModelBehavior::_addToWhitelist ( &$  model,
field 
)

If $model's whitelist property is non-empty, $field will be added to it. Note: this method should *only* be used in beforeValidate or beforeSave to ensure that it only modifies the whitelist for the current save operation. Also make sure you explicitly set the value of the field which you are allowing.

Parameters:
object $model Model using this behavior
string $field Field to be added to $model's whitelist protected
Returns:
void

Definition at line 186 of file behavior.php.

ModelBehavior::afterDelete ( &$  model  ) 

After delete callback

Parameters:
object $model Model using this behavior public

Reimplemented in AclBehavior, and TranslateBehavior.

Definition at line 136 of file behavior.php.

ModelBehavior::afterFind ( &$  model,
results,
primary 
)

After find callback. Can be used to modify any results returned by find and findAll.

Parameters:
object $model Model using this behavior
mixed $results The results of the find operation
boolean $primary Whether this model is being queried directly (vs. being queried as an association)
Returns:
mixed Result of the find operation public

Reimplemented in ContainableBehavior, and TranslateBehavior.

Definition at line 96 of file behavior.php.

ModelBehavior::afterSave ( &$  model,
created 
)

After save callback

Parameters:
object $model Model using this behavior
boolean $created True if this save created a new record public

Reimplemented in AclBehavior, TranslateBehavior, and TreeBehavior.

Definition at line 120 of file behavior.php.

ModelBehavior::beforeDelete ( &$  model,
cascade = true 
)

Before delete callback

Parameters:
object $model Model using this behavior
boolean $cascade If true records that depend on this record will also be deleted
Returns:
boolean True if the operation should continue, false if it should abort public

Definition at line 129 of file behavior.php.

ModelBehavior::beforeFind ( &$  model,
query 
)

Before find callback

Parameters:
object $model Model using this behavior
array $queryData Data used to execute this query, i.e. conditions, order, etc.
Returns:
boolean True if the operation should continue, false if it should abort public

Reimplemented in ContainableBehavior, and TranslateBehavior.

Definition at line 86 of file behavior.php.

ModelBehavior::beforeSave ( &$  model  ) 

Before save callback

Parameters:
object $model Model using this behavior
Returns:
boolean True if the operation should continue, false if it should abort public

Reimplemented in TreeBehavior.

Definition at line 112 of file behavior.php.

Referenced by TranslateBehavior::afterSave(), and TranslateBehavior::beforeValidate().

ModelBehavior::beforeValidate ( &$  model  ) 

Before validate callback

Parameters:
object $model Model using this behavior
Returns:
boolean True if validate operation should continue, false to abort public

Reimplemented in TranslateBehavior.

Definition at line 104 of file behavior.php.

ModelBehavior::cleanup ( &$  model  ) 

Clean up any initialization this behavior has done on a model. Called when a behavior is dynamically detached from a model using Model::detach().

Parameters:
object $model Model using this behavior public
See also:
BehaviorCollection::detach()

Reimplemented in TranslateBehavior.

Definition at line 73 of file behavior.php.

ModelBehavior::dispatchMethod ( &$  model,
method,
params = array() 
)

Overrides Object::dispatchMethod to account for PHP4's broken reference support

See also:
Object::dispatchMethod public
Returns:
mixed

Definition at line 152 of file behavior.php.

ModelBehavior::onError ( &$  model,
error 
)

DataSource error callback

Parameters:
object $model Model using this behavior
string $error Error generated in DataSource public

Definition at line 144 of file behavior.php.

ModelBehavior::setup ( &$  model,
config = array() 
)

Setup this behavior with the specified configuration settings.

Parameters:
object $model Model using this behavior
array $config Configuration settings for $model public

Reimplemented in AclBehavior, ContainableBehavior, TranslateBehavior, and TreeBehavior.

Definition at line 64 of file behavior.php.


Member Data Documentation

ModelBehavior::$mapMethods = array()

Definition at line 56 of file behavior.php.

ModelBehavior::$settings = array()

Definition at line 46 of file behavior.php.

Referenced by TreeBehavior::setup(), and ContainableBehavior::setup().


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:56 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7