eZ\Publish\Core\Search\Legacy\Content\Gateway\DoctrineDatabase::find PHP Method

find() public method

Returns a list of object satisfying the $filter.
public find ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, integer $offset, integer $limit, array $sort = null, array $languageFilter = [], boolean $doCount = true ) : mixed[][]
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
$offset integer
$limit integer
$sort array
$languageFilter array
$doCount boolean
return mixed[][]
    public function find(Criterion $criterion, $offset, $limit, array $sort = null, array $languageFilter = array(), $doCount = true)
    {
        $count = $doCount ? $this->getResultCount($criterion, $languageFilter) : null;
        if (!$doCount && $limit === 0) {
            throw new \RuntimeException('Invalid query, can not disable count and request 0 items at the same time');
        }
        if ($limit === 0 || $count !== null && $count <= $offset) {
            return array('count' => $count, 'rows' => array());
        }
        $contentInfoList = $this->getContentInfoList($criterion, $sort, $offset, $limit, $languageFilter);
        return array('count' => $count, 'rows' => $contentInfoList);
    }