コード例 #1
0
ファイル: abstract.php プロジェクト: stonyyi/anahita
 /**
  * Mixin an object 
  *
  * @param   object  An object that implements KMinxInterface
  * @return  KObject
  */
 public function mixin(KMixinInterface $object, $config = array())
 {
     if ($object instanceof KControllerBehaviorAbstract) {
         foreach ($object->getMethods() as $method) {
             if (substr($method, 0, 7) == '_action') {
                 $this->_actions[] = strtolower(substr($method, 7));
             }
         }
         $this->_actions = array_unique(array_merge($this->_actions, array_keys($this->_action_map)));
     }
     return parent::mixin($object, $config);
 }
コード例 #2
0
ファイル: object.php プロジェクト: raeldc/com_learn
    /**
     * Mixin an object
     *
     * When using mixin(), the calling object inherits the methods of the mixed
     * in objects, in a LIFO order. 
     *
     * @param   object  An object that implements KMinxInterface
     * @return  KObject
     */
    public function mixin(KMixinInterface $object)
    {
        $methods = $object->getMixableMethods($this);

        foreach($methods as $method) {
            $this->_mixed_methods[$method] = $object;
        }
        
        //Set the mixer
        $object->setMixer($this);
        
        return $this;
    }
コード例 #3
0
ファイル: object.php プロジェクト: ravenlife/Ninja-Framework
 /**
  * Mixin an object
  *
  * When using mixin(), the calling object inherits the methods of the mixed
  * in objects, in a LIFO order. 
  * 
  * This function notifies the mixing through the onMixin function it is being
  * mixed.
  *
  * @param   object  An object that implements KMinxInterface
  * @return  KObject
  */
 public function mixin(KMixinInterface $object)
 {
     $methods = $object->getMixableMethods($this);
     foreach ($methods as $method) {
         $this->_mixed_methods[$method] = $object;
     }
     //Notify the mixin
     $object->mixer = $this;
     $object->onMixin();
     return $this;
 }