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; }
/** * @param $attribute * @return string */ public function getField($attribute) { $table = $this->config->getTable($this->entityName); $field = $this->config->getFiled($this->entityName, $attribute); return $table . "." . $field; }
public function testGetNamespace() { $this->assertEquals('Tasks\\Task', $this->config->getNamespace('Task')); }