示例#1
0
 /**
  * Add a command by it's name
  *
  * @param   string  $method Method name
  * @param   array   $args   Array containing all the arguments for the original call
  * @return mixed
  * @see addCommand()
  */
 public function __call($method, $args)
 {
     $parts = KStringInflector::explode($method);
     if ($parts[0] == 'add' && isset($parts[1])) {
         $config = isset($args[0]) ? $args[0] : array();
         $command = $this->addCommand(strtolower($parts[1]), $config);
         return $command;
     }
     return parent::__call($method, $args);
 }
示例#2
0
 /**
  * Initializes the options for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   KObjectConfig $config  An optional ObjectConfig object with configuration options
  * @return  void
  */
 protected function _initialize(KObjectConfig $config)
 {
     $config->append(array('priority' => self::PRIORITY_LOWEST, 'event_publisher' => 'event.publisher', 'immutable' => false));
     parent::_initialize($config);
 }