Example #1
0
 /**
  * Constructor.
  *
  * @param KConfig $config An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config)
 {
     KService::set($config->service_identifier, $this);
     parent::__construct($config);
     $this->_entityset = $config->entityset;
     $this->_prototype = $config->prototype;
     $this->_store = $config->store;
     $this->_space = $config->space;
     $this->_resources = $config->resources;
     $this->_description = new AnDomainDescriptionDefault($config);
     //$this->_description		 = $this->getService($config->description, KConfig::unbox($config));
     //now set the attributes and relationships
     $this->_description->setAttribute(KConfig::unbox($config->attributes));
     $this->_description->setRelationship(KConfig::unbox($config->relationships));
     $this->_query = $this->getService($config->query, $config->toArray());
     // Mixin the behavior interface
     $config->mixer = $this;
     $this->mixin(new KMixinCommand($config));
     $this->mixin(new KMixinBehavior($config));
     //insert the reposiry with highest priority
     $this->getCommandChain()->enqueue($this, -PHP_INT_MAX);
 }