コード例 #1
0
 public function buildCustomCriteria($criteriaName, $baseCriteria)
 {
     $customCriteria = ucfirst($criteriaName);
     $customCriteriaClass = $this->config->getCustomCriteriaClass($baseCriteria->getEntityName(), $customCriteria);
     if (!class_exists($customCriteriaClass)) {
         throw new RuntimeException(sprintf('Wrong criteria %s. Class %s does not exists.', $customCriteria, $customCriteriaClass));
     }
     $customCriteriaInstance = new $customCriteriaClass();
     if (!is_callable($customCriteriaInstance)) {
         throw new RuntimeException(sprintf('Wrong criteria %s. Object of type %s is not callable.', $customCriteria, $customCriteriaClass));
     }
     return $customCriteriaInstance;
 }
コード例 #2
0
ファイル: Criteria.php プロジェクト: t4web/infrastructure
 /**
  * @param $attribute
  * @return string
  */
 public function getField($attribute)
 {
     $table = $this->config->getTable($this->entityName);
     $field = $this->config->getFiled($this->entityName, $attribute);
     return $table . "." . $field;
 }
コード例 #3
0
ファイル: ConfigTest.php プロジェクト: t4web/infrastructure
 public function testGetNamespace()
 {
     $this->assertEquals('Tasks\\Task', $this->config->getNamespace('Task'));
 }