Пример #1
0
 /**
  * Mixin an object
  *
  * When using mixin(), the calling object inherits the methods of the mixed in objects, in a LIFO order.
  *
  * @@param   mixed  $mixin  An object that implements KObjectMixinInterface, KObjectIdentifier object
  *                          or valid identifier string
  * @param    array $config  An optional associative array of configuration options
  * @return  KObject
  */
 public function mixin($mixin, $config = array())
 {
     if ($mixin instanceof KControllerBehaviorAbstract) {
         $actions = $this->getActions();
         foreach ($mixin->getMethods() as $method) {
             if (substr($method, 0, 7) == '_action') {
                 $actions[] = strtolower(substr($method, 7));
             }
         }
         $this->_actions = array_unique($actions);
     }
     return parent::mixin($mixin, $config);
 }
Пример #2
0
 /**
  * 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);
 }