protected function makeConfiguration($packageConfiguration, $resourceName) { $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $refClass = new \ReflectionClass($class); $methods = $refClass->getMethods(); $reader = $this->container->get('AnnotationReader'); $calls = array(); foreach ($methods as $method) { $annotations = $reader->getMethodAnnotations($method); foreach ($annotations as $annotation) { if ($annotation instanceof \EVFramework\Annotation\GeneratorCallDICIT) { $calls[$method->getName()] = array("@" . DefinitionHelper::getServiceName($this->container, $annotation->getResource(), $annotation->getType())); } } if ($method->getName() == 'setContainer') { $calls[$method->getName()] = array('$container'); } } $configuration = array('class' => $class, 'singleton' => 'true', 'arguments' => array('$container', $resourceName)); if (count($calls)) { $configuration['call'] = $calls; } // var_export($configuration); // die(); return $configuration; }
protected function makeConfiguration($packageConfiguration, $resourceName) { $voName = $packageConfiguration[Definition::OBJECT_NAME]; $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $configuration = array('class' => $class, 'singleton' => 'true', 'call' => array('setErrors' => array('@FunctionalListException'))); return $configuration; }
protected function makeConfiguration($packageConfiguration, $resourceName) { $tableName = $packageConfiguration[Definition::OBJECT_TABLE_NAME]; $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $configuration = array('class' => $class, 'singleton' => 'true', 'call' => array('setDb' => array('@DbWriter'), 'setTableName' => array($tableName))); return $configuration; }
protected function makeConfiguration($packageConfiguration, $resourceName) { $managerName = DefinitionHelper::getServiceName($this->container, $resourceName, ManagerBuilder::NAME); $builderName = DefinitionHelper::getServiceName($this->container, $resourceName, BuilderBuilder::NAME); $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $configuration = array('class' => $class, 'singleton' => 'true', 'arguments' => array('@' . $managerName, '@' . $builderName)); return $configuration; }
protected function makeConfiguration($packageConfiguration, $resourceName) { $pgStoreName = DefinitionHelper::getServiceName($this->container, $resourceName, 'PersistentStore'); $memcachedStoreName = DefinitionHelper::getServiceName($this->container, $resourceName, 'MemcachedStore'); $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $configuration = array('class' => $class, 'singleton' => 'true', 'call' => array('addStore[1]' => array('@' . $pgStoreName))); return $configuration; }
protected function makeConfiguration($packageConfiguration, $resourceName) { $readerName = DefinitionHelper::getServiceName($this->container, $resourceName, ReaderBuilder::NAME); $writerName = DefinitionHelper::getServiceName($this->container, $resourceName, WriterBuilder::NAME); $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $configuration = array('class' => $class, 'singleton' => 'true', 'call' => array('setReader' => array('@' . $readerName), 'setWriter' => array('@' . $writerName))); return $configuration; }
protected function makeConfiguration($packageConfiguration, $resourceName) { $validatorName = DefinitionHelper::getServiceName($this->container, $resourceName, ValidatorBuilder::NAME); $storageName = DefinitionHelper::getServiceName($this->container, $resourceName, StorageBuilder::NAME); $voName = $packageConfiguration[Definition::OBJECT_NAME]; $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $configuration = array('class' => $class, 'singleton' => 'true', 'call' => array('setValidator' => array('@' . $validatorName), 'setStorage' => array('@' . $storageName), 'setVOFQCN' => array($voName))); return $configuration; }
public function getRESTFQCNImplementation() { $class = DefinitionHelper::getClassImplementation($this->container, $this->resourceName, 'REST', null); if (!$class) { throw new NotImplementedException('REST object for resource ' . $this->resourceName . ' not implemented'); } else { return $class; } }
protected function makeConfiguration($packageConfiguration, $resourceName) { $class = DefinitionHelper::getClassImplementation($this->container, $resourceName, static::NAME, static::BASE_CLASS); $configuration = array('class' => $class, 'arguments' => array('@Memcached'), 'singleton' => 'true', 'call' => array('setPrefix' => array('berthe'), 'setName' => array($resourceName), 'setSuffix' => array('all'))); return $configuration; }