public function addBehavior($behavior, $config = array())
    {
        if (! ($behavior instanceof AnBehaviorInterface)) {
            $behavior = $this->_mixer->getBehavior($behavior, $config);
        }

        //Add the behaviors
        $this->_behaviors[$behavior->getIdentifier()->name] = $behavior;

        //Enqueue the behavior
        $this->getCommandChain()->enqueue($behavior);

        //Mixin the behavior
        if ($this->_auto_mixin) {
            $this->mixin($behavior);
        }

        return $this->_mixer;
    }
public function addBehavior($behavior, $config = array())
    {
        if (! ($behavior instanceof AnBehaviorInterface)) {
            $behavior = $this->_mixer->getBehavior($behavior, $config);
        }

        //Add the behaviors
        $this->_behaviors[$behavior->getIdentifier()->name] = $behavior;

        //Enqueue the behavior
        $this->getCommandChain()->enqueue($behavior);

        //Mixin the behavior
        if ($this->_auto_mixin) {
            $this->mixin($behavior);
        }

        return $this->_mixer;
    }
public function addBehavior ( $ behavior , $ config = array ( ) ) { if ( ! ( $ behavior instanceof AnBehaviorInterface ) ) { $ behavior = $ this -> _mixer -> getBehavior ( $ behavior , $ config ) ; } //Add the behaviors $ this -> _behaviors [ $ behavior -> getIdentifier ( ) -> name ] = $ behavior ; //Enqueue the behavior $ this -> getCommandChain ( ) -> enqueue ( $ behavior ) ; //Mixin the behavior if ( $ this -> _auto_mixin ) { $ this -> mixin ( $ behavior ) ; } return $ this -> _mixer ; }
Add one or more behaviors to the controller

@param   mixed	An object that implements AnObjectServiceable, AnServiceIdentifier object
or valid identifier string
@param	array An optional associative array of configuration settings
@return  AnObject	The mixer object
Add one or more behaviors to the controller