ArticleImagesList::CreateList PHP Method

CreateList() protected method

Creates the list of objects. Sets the parameter $p_hasNextElements to true if this list is limited and elements still exist in the original list (from which this was truncated) after the last element of this list.
protected CreateList ( integer $p_start, integer $p_limit, array $p_parameters, &$p_count ) : array
$p_start integer
$p_limit integer
$p_parameters array
return array
    protected function CreateList($p_start = 0, $p_limit = 0, array $p_parameters, &$p_count)
    {
        $cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
        $cacheKey = $cacheService->getCacheKey(array('ArticleImagesList', implode('-', $this->m_constraints), implode('-', $this->m_order), $p_start, $p_limit, implode('-', $p_parameters), $p_count), 'article_image');
        if ($cacheService->contains($cacheKey)) {
            $metaImagesList = $cacheService->fetch($cacheKey);
        } else {
            $articleImagesList = ArticleImage::GetList($this->m_constraints, $this->m_order, $p_start, $p_limit, $p_count);
            $metaImagesList = array();
            foreach ($articleImagesList as $image) {
                $metaImagesList[] = new MetaImage($image->getImageId());
            }
            $cacheService->save($cacheKey, $metaImagesList);
        }
        return $metaImagesList;
    }