@param Criteria $object

@return Criteria
187773
public function process($object = null)
    {
        if ($object === null) {
            $object = new Criteria();
        }

        return parent::process($object);
    }
1276803
public function GetCustomQuery($objectclass, $criteria)
	{
		$this->IncludeModel($objectclass);
		$sql = call_user_func( array($objectclass,"GetCustomQuery"),$criteria );
		return $sql;
	}
790920
public function load($criteria)
    {
        $pool       = $this->manager->getPool();
        $manager_id = $this->class->getManagerIdentifier();

        if (!is_array($criteria)) {
            $criteria = array($this->class->getFieldIdentifier() => $criteria);
        }

        $model = $pool->getManager($manager_id)
            ->getRepository($this->class->getFieldMapping($manager_id)->getName())
            ->findOneBy($criteria);

        if (null === $model) {
            return null;
        }

        $builder = new ModelBuilder($this->manager, $this->uow, $this->class);

        return $builder->build($model, $manager_id);
    }
776056
public function buildCriteria()
    {
        $criteria = new Criteria(CustomerGroupI18nTableMap::DATABASE_NAME);

        if ($this->isColumnModified(CustomerGroupI18nTableMap::ID)) $criteria->add(CustomerGroupI18nTableMap::ID, $this->id);
        if ($this->isColumnModified(CustomerGroupI18nTableMap::LOCALE)) $criteria->add(CustomerGroupI18nTableMap::LOCALE, $this->locale);
        if ($this->isColumnModified(CustomerGroupI18nTableMap::TITLE)) $criteria->add(CustomerGroupI18nTableMap::TITLE, $this->title);
        if ($this->isColumnModified(CustomerGroupI18nTableMap::DESCRIPTION)) $criteria->add(CustomerGroupI18nTableMap::DESCRIPTION, $this->description);

        return $criteria;
    }
1229415
public function matching(Criteria $criteria)
    {
        $visitor = new QueryExpressionVisitor($this->createQueryBuilder());
        $queryBuilder = $this->createQueryBuilder();

        if ($criteria->getWhereExpression() !== null) {
            $expr = $visitor->dispatch($criteria->getWhereExpression());
            $queryBuilder->setQueryArray($expr->getQuery());
        }

        if ($criteria->getMaxResults() !== null) {
            $queryBuilder->limit($criteria->getMaxResults());
        }

        if ($criteria->getFirstResult() !== null) {
            $queryBuilder->skip($criteria->getFirstResult());
        }

        if ($criteria->getOrderings() !== null) {
            $queryBuilder->sort($criteria->getOrderings());
        }

        // @TODO: wrap around a specialized Collection for efficient count on large collections
        return new ArrayCollection($queryBuilder->getQuery()->execute()->toArray());
    }
139738
public function prepareObject($object)
    {
        $tokenList = $this->getMethodTokenList();

        for ($i = 0, $c = count($tokenList); $i < $c; $i++) {
            if ($this->reflection->hasMethod(self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']))) {
                $m = self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']);
                if ($tokenList[$i]['type'] == RouteMethodAnnotaionParser::TYPE_CLASS) {
                    $value = new $tokenList[$i]['value']();
                } else {
                    $value = $tokenList[$i]['value'];
                }
                $object->$m($value);
            }
        }

        return $object;
    }
1038175
function eq($object)
    {
        if ($object instanceof Entity){
            return $this->uri() === $object->uri();
        }
        return isset($object) && ($this->uri() === $object);
    }
846064
public function criteria(Criteria\Criteria $cri = null)
    {
        if (! $cri) $cri = new Criteria\Criteria($this);
        $cri->setTable($this);

        return $cri;
    }
984094
public function searchEntities(CriteriaBase $criteria)
    {
        $this->throttler->throttle();
        $query = $criteria ? get_object_vars($criteria) : array();

        $entityName = $criteria->getEntityName();

        $url = $this->_buildURL($criteria->getEntityListName(), $query);
        $response = $this->client->get($url)->send();
        //check exception in response
        $this->checkException($response);



        $entityXMLItems = $response->xml()->{$entityName . 'List'}->{$entityName};
        if(!$entityXMLItems){
            $entityXMLItems = $response->xml()->{$entityName . 'List'}->{$entityName. 'ListItem'};
        }

        $res = array();

        /**
         * @var \Dlin\Saasu\Entity\EntityBase $entity
         */
        foreach ($entityXMLItems as $item) {
            $fullClass = $criteria->getEntityClass();
            $entity = new $fullClass();
            $entity->fromXML($item->asXML());
            $res[] = $entity;
        }
        return $res;

    }
477760
public function getCriteriaType($criteria) {
        $type = gettype($criteria);
        if ($type === 'object') {
            $type = get_class($criteria);
            if (!$criteria instanceof Om\xPDOCriteria) {
                $this->log(xPDO::LOG_LEVEL_WARN, "Invalid criteria object of class {$type} encountered.", '', __METHOD__, __FILE__, __LINE__);
                $type = null;
            } elseif ($criteria instanceof Om\xPDOQuery) {
                $type = 'xPDOQuery';
            } else {
                $type = 'xPDOCriteria';
            }
        }
        return $type;
    }
685617
public function addCriteria($criteria = null, $operator = 'AND')
    {
        if ($criteria instanceof Criteria) {
            $query = $criteria->getQuery();
            // 添加 WHERE 条件
            isset($query['where']) && $this->addWhere($query['where'], $criteria->getParams(), $operator);
        }
        return $this;
    }
1165680
public function find($class, Criteria $criteria=null)
    {
        return new Collection($class,
            $this->query($criteria, $this->_pheasant->schema($class)->alias()));
    }
1054022
public function find($criteria = null, $projection = null) {
        return new Cursor($this, $this->database->registerCriteriaFunction($criteria), $projection);
    }
686629
public function hasRequirement($object, $requirement = null)
    {
        return isset($this->requirements[$object])
            && ($requirement === null || in_array($requirement, $this->requirements[$object], true));
    }
144528
protected static function processCriteriaWithType(&$criteria){

        $class = get_called_class();
        $types = $class::getModelTypes();
        if (count($types) > 1) {
            $criteria['_type'] = $class::getClassName(false);
        }

    }
435836
public function countByCriteria(Criteria $criteria)
    {
        $qb = $this->createCriteriaQueryBuilder($criteria, 'm');

        $qb->select('COUNT(m.id)');

        return $qb->getQuery()->getSingleScalarResult();
    }
908885
public function buildCriteria()
    {
        $criteria = new Criteria(RolePermissionTableMap::DATABASE_NAME);

        if ($this->isColumnModified(RolePermissionTableMap::COL_ROLE_ID)) {
            $criteria->add(RolePermissionTableMap::COL_ROLE_ID, $this->role_id);
        }
        if ($this->isColumnModified(RolePermissionTableMap::COL_PERMISSION_ID)) {
            $criteria->add(RolePermissionTableMap::COL_PERMISSION_ID, $this->permission_id);
        }

        return $criteria;
    }