BehaviorCollection Class Reference

Inheritance diagram for BehaviorCollection:

Object List of all members.

Public Member Functions

 attach ($behavior, $config=array())
 attached ($name=null)
 detach ($name)
 disable ($name)
 dispatchMethod (&$model, $method, $params=array(), $strict=false)
 enable ($name)
 enabled ($name=null)
 init ($modelName, $behaviors=array())
 methods ()
 trigger (&$model, $callback, $params=array(), $options=array())

Public Attributes

 $__mappedMethods = array()
 $__methods = array()
 $_attached = array()
 $_disabled = array()
 $modelName = null

Detailed Description

Definition at line 207 of file behavior.php.


Member Function Documentation

BehaviorCollection::attach ( behavior,
config = array() 
)

Attaches a behavior to a model

Parameters:
string $behavior CamelCased name of the behavior to load
array $config Behavior configuration parameters
Returns:
boolean True on success, false on failure public

Definition at line 264 of file behavior.php.

References $config, ClassRegistry::addObject(), disable(), enable(), enabled(), ClassRegistry::getObject(), App::import(), and ClassRegistry::isKeySet().

Referenced by init().

BehaviorCollection::attached ( name = null  ) 

Gets the list of attached behaviors, or, whether the given behavior is attached

Parameters:
string $name Optional. The name of the behavior to check the status of. If omitted, returns an array of currently-attached behaviors
Returns:
mixed If $name is specified, returns the boolean status of the corresponding behavior. Otherwise, returns an array of all attached behaviors. public

Definition at line 487 of file behavior.php.

BehaviorCollection::detach ( name  ) 

Detaches a behavior from a model

Parameters:
string $name CamelCased name of the behavior to unload
Returns:
void public

Definition at line 341 of file behavior.php.

References ClassRegistry::getObject().

BehaviorCollection::disable ( name  ) 

Disables callbacks on a behavior or array of behaviors. Public behavior methods are still callable as normal.

Parameters:
mixed $name CamelCased name of the behavior(s) to disable (string or array)
Returns:
void public

Definition at line 371 of file behavior.php.

Referenced by attach().

BehaviorCollection::dispatchMethod ( &$  model,
method,
params = array(),
strict = false 
)

Dispatches a behavior method

Returns:
array All methods for all behaviors attached to this object public

Definition at line 399 of file behavior.php.

BehaviorCollection::enable ( name  ) 

Enables callbacks on a behavior or array of behaviors

Parameters:
mixed $name CamelCased name of the behavior(s) to enable (string or array)
Returns:
void public

Definition at line 360 of file behavior.php.

Referenced by attach().

BehaviorCollection::enabled ( name = null  ) 

Gets the list of currently-enabled behaviors, or, the current status of a single behavior

Parameters:
string $name Optional. The name of the behavior to check the status of. If omitted, returns an array of currently-enabled behaviors
Returns:
mixed If $name is specified, returns the boolean status of the corresponding behavior. Otherwise, returns an array of all enabled behaviors. public

Definition at line 387 of file behavior.php.

Referenced by attach().

BehaviorCollection::init ( modelName,
behaviors = array() 
)

Attaches a model object and loads a list of behaviors

public

Returns:
void

Definition at line 247 of file behavior.php.

References $config, $modelName, attach(), and Set::normalize().

BehaviorCollection::methods (  ) 

Gets the method list for attached behaviors, i.e. all public, non-callback methods

Returns:
array All public methods for all behaviors attached to this collection public

Definition at line 475 of file behavior.php.

BehaviorCollection::trigger ( &$  model,
callback,
params = array(),
options = array() 
)

Dispatches a behavior callback on all attached behavior objects

Parameters:
model $model
string $callback
array $params
array $options
Returns:
mixed public

Definition at line 443 of file behavior.php.


Member Data Documentation

BehaviorCollection::$__mappedMethods = array()

Definition at line 240 of file behavior.php.

BehaviorCollection::$__methods = array()

Definition at line 234 of file behavior.php.

BehaviorCollection::$_attached = array()

Definition at line 221 of file behavior.php.

BehaviorCollection::$_disabled = array()

Definition at line 228 of file behavior.php.

BehaviorCollection::$modelName = null

Definition at line 214 of file behavior.php.

Referenced by init().


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