data/model/Behaviors.php
public static function bindBehavior($name, array $config = []) {
		list($model, $class) = static::_classesForBehavior($name);
		static::_initializeBehaviors();

		if (is_object($name)) {
			$name->config($config);
		} else {
			if (!class_exists($class)) {
				$message  = "Behavior class `{$class}` does not exist. ";
				$message .= "Its name might be misspelled. Behavior was requested by ";
				$message .= "model `{$model}`.";
				throw new Exception($message);
			}
			$name = new $class($config + compact('model'));
		}
		static::$_behaviors[$model][$class] = $name;
	}
public static function bindBehavior($name, array $config = []) {
		list($model, $class) = static::_classesForBehavior($name);
		static::_initializeBehaviors();

		if (is_object($name)) {
			$name->config($config);
		} else {
			if (!class_exists($class)) {
				$message  = "Behavior class `{$class}` does not exist. ";
				$message .= "Its name might be misspelled. Behavior was requested by ";
				$message .= "model `{$model}`.";
				throw new Exception($message);
			}
			$name = new $class($config + compact('model'));
		}
		static::$_behaviors[$model][$class] = $name;
	}
public static function bindBehavior ( $ name , array $ config = [ ] ) { list ( $ model , $ class ) = static :: _classesForBehavior ( $ name ) ; static :: _initializeBehaviors ( ) ; if ( is_object ( $ name ) ) { $ name -> config ( $ config ) ; } else { if ( ! class_exists ( $ class ) ) { $ message = "Behavior class `{$class}` does not exist. " ; $ message .= "Its name might be misspelled. Behavior was requested by " ; $ message .= "model `{$model}`." ; throw new Exception ( $ message ) ; } $ name = new $ class ( $ config + compact ( 'model' ) ) ; } static :: $ _behaviors [ $ model ] [ $ class ] = $ name ; }
Binds a new instance of a behavior to the model using given config or
entirely replacing an existing behavior instance with new config.

@param string|object $name The name of the behavior or an instance of it.
@param array $config Configuration for the behavior instance.
Binds a new instance of a behavior to the model using given config or entirely replacing an existing behavior instance with new config .