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);
}