Exemple #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(
            'dispatcher'   => KFactory::get('koowa:event.dispatcher')
        ));

        parent::_initialize($config);
    }
 /**
  * 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('dispatcher' => $this->getService('koowa:event.dispatcher')));
     parent::_initialize($config);
 }
 /**
  * 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)
 {
     $config->append(array('priority' => KCommand::PRIORITY_HIGH));
     parent::_initialize($config);
 }
Exemple #4
0
 /**
  * Initializes the default configuration for the object.
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 protected function _initialize(KConfig $config)
 {
     if (empty($config->resources)) {
         $resource = $this->getIdentifier()->package . '_' . KInflector::pluralize($this->getIdentifier()->name);
         $config->append(array('resources' => array($resource)));
     }
     $entityset = clone $this->getIdentifier();
     $entityset->path = array('domain', 'entityset');
     register_default(array('identifier' => $entityset, 'prefix' => $config->prototype));
     $description = clone $this->getIdentifier();
     $description->path = array('domain', 'description');
     register_default(array('identifier' => $description, 'prefix' => $config->prototype));
     $query = clone $this->getIdentifier();
     $query->path = array('domain', 'query');
     register_default(array('identifier' => $query, 'prefix' => $config->prototype));
     $config->append(array('query' => $query, 'space' => $this->getService('anahita:domain.space'), 'store' => $this->getService('anahita:domain.store.database'), 'entityset' => $entityset, 'description' => $description, 'command_chain' => $this->getService('koowa:command.chain'), 'event_dispatcher' => $this->getService('koowa:event.dispatcher'), 'dispatch_events' => true, 'enable_callbacks' => true, 'behaviors' => array('validatable', 'cachable', 'serializable')));
     //set the resources
     $resources = array_reverse((array) KConfig::unbox($config->resources));
     $config['resources'] = new AnDomainResourceSet(new KConfig(array('store' => $config->store, 'resources' => $resources)));
     $config['repository'] = $this;
     parent::_initialize($config);
 }
Exemple #5
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));
     parent::_initialize($config);
 }