Пример #1
0
 /**
  * Initializes the options for the object
  * 
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   object  An optional KConfig object with configuration options
  * @return  void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array(
         'event_dispatcher' => new KEventDispatcher(),
     ));
     
     parent::_initialize($config);
 }
Пример #2
0
	protected function _initialize(KConfig $config)
	{
		if (empty($config->adapters)) {
			$config->adapters = array('finfo', 'mime_content_type', 'mimemagic');
		}
		elseif (is_string($config->adapters)) {
			$config->adapters = array($config->adapters);
		}

		parent::_initialize($config);
	}
Пример #3
0
 /**
  * Initializes the options for the object
  * 
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   object  An optional KConfig object with configuration options
  * @return  void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array(
         'command_chain'     => new KCommandChain(),
         'event'				=> KFactory::get('koowa:command.event'),
         'dispatch_events'   => true,
         'event_priority'    => KCommand::PRIORITY_LOWEST,
         'enable_callbacks'  => false,
         'callback_priority' => KCommand::PRIORITY_HIGH,
     ));
     
     parent::_initialize($config);
 }
Пример #4
0
 /**
  * Initializes the options for the object
  * 
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   object  An optional KConfig object with configuration options
  * @return  void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('event_dispatcher' => null, 'event_subscribers' => array(), 'event_listeners' => array()));
     parent::_initialize($config);
 }
Пример #5
0
 /**
  * Get the methods that are available for mixin. 
  * 
  * This functions overloads KMixinAbstract::getMixableMethods and excludes the execute()
  * function from the list of available mixable methods.
  * 
  * @return array An array of methods
  */
 public function getMixableMethods(KObject $mixer = null)
 {
     return array_diff(parent::getMixableMethods(), array('execute', 'getPriority'));
 }
Пример #6
0
 /**
  * Get the methods that are available for mixin based 
  * 
  * This function also dynamically adds a function of format is[Behavior] 
  * to allow client code to check if the behavior is callable. 
  * 
  * @param object The mixer requesting the mixable methods. 
  * @return array An array of methods
  */
 public function getMixableMethods(KObject $mixer = null)
 {
     $methods = parent::getMixableMethods($mixer);
     $methods[] = 'is' . ucfirst($this->_identifier->name);
     return array_diff($methods, array('execute', 'save', 'delete'));
 }
Пример #7
0
 /**
  * Get an object handle
  *
  * Force the object to be enqueue in the command chain.
  *
  * @return string A string that is unique, or NULL
  * @see execute()
  */
 public function getHandle()
 {
     return KMixinAbstract::getHandle();
 }
Пример #8
0
 /**
  * Get the methods that are available for mixin based
  *
  * This function also dynamically adds a function of format is[Behavior]
  * to allow client code to check if the behavior is callable.
  *
  * @param object The mixer requesting the mixable methods.
  * @return array An array of methods
  */
 public function getMixableMethods(KObject $mixer = null)
 {
     $methods = parent::getMixableMethods($mixer);
     $methods[] = 'is' . ucfirst($this->getIdentifier()->name);
     foreach ($this->getMethods() as $method) {
         if (substr($method, 0, 7) == '_action') {
             $methods[] = strtolower(substr($method, 7));
         }
     }
     return array_diff($methods, array('execute', 'getIdentifier', 'getPriority', 'getHandle', 'getService', 'getIdentifier'));
 }
Пример #9
0
 /**
  * Initializes the options for the object
  * 
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   object  An optional KConfig object with configuration options
  * @return  void
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('command_chain' => null, 'event_dispatcher' => null, 'dispatch_events' => true, 'event_priority' => KCommand::PRIORITY_LOWEST, 'enable_callbacks' => false, 'callback_priority' => KCommand::PRIORITY_HIGH));
     parent::_initialize($config);
 }
Пример #10
0
 /**
  * Initializes the options for the object
  * 
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   array   Options
  * @return  array   Options
  */
 protected function _initialize(KConfig $options)
 {
     $options->append(array('views' => array()));
     parent::_initialize($options);
 }
Пример #11
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param 	object 	An optional KConfig object with configuration options.
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     parent::_initialize($config);
     $config->append(array('toolbars' => array()));
 }
 /**
  * Get the methods that are available for mixin based
  *
  * This function also dynamically adds a function of format is[Behavior]
  * to allow client code to check if the behavior is callable.
  *
  * @param object The mixer requesting the mixable methods.
  * @return array An array of methods
  */
 public function getMixableMethods(KObject $mixer = null)
 {
     $methods = parent::getMixableMethods($mixer);
     $methods[] = 'is' . ucfirst($this->getIdentifier()->name);
     return array_diff($methods, array('execute', 'save', 'delete', 'getHandle', 'getPriority', 'getIdentifier', 'getService'));
 }
Пример #13
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param 	object 	An optional KConfig object with configuration options.
  * @return void
  */
 protected function _initialize(KConfig $config)
 {
     parent::_initialize($config);
     $config->append(array('behaviors' => array(), 'auto_mixin' => true));
 }