Exemple #1
0
    /**
     * 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;
    }
Exemple #2
0
 /**
  * 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;
 }