public function getWhereParams(array $criteria) { $whereParams = []; foreach ($criteria as $field => $value) { if (is_object($value)) { $class = StringUtils::cutClassName(get_class($value)); switch ($class) { case "Between": /** @var Between $value */ $whereParams[] = $value->getStart(); $whereParams[] = $value->getEnd(); break; case "ILike": /** @var ILike $value */ $whereParams[] = $value->getQuery(); break; case "PgPoint": break; default: throw new \InvalidArgumentException("where class {$class} not implement"); } } elseif (is_array($value)) { foreach ($value as $valueItem) { $whereParams[] = $valueItem; } } elseif (is_null($value)) { continue; } else { $whereParams[] = $value; } } return $whereParams; }
public function getEntityClass() { $className = $this->getMetaInfo("class"); if (empty($className)) { $namespace = StringUtils::cutNamespace($this); $class = StringUtils::cutClassName($this); $class = StringUtils::singularEn(substr($class, 0, strpos($class, "Manager"))); $className = $namespace . "\\" . ucfirst($class); $this->metaInfo["class"] = $className; } return $className; }