/** * Parse one or more items and return them as array * * @param \Model\Collection $objArticles * @param boolean $blnAddArchive * * @return array */ protected function parseArticles($objArticles, $blnAddArchive = false) { $limit = $objArticles->count(); if ($limit < 1) { return array(); } $count = 0; $arrArticles = array(); while ($objArticles->next()) { /** @var \NewsModel $objArticle */ $objArticle = $objArticles->current(); $arrArticles[] = $this->parseArticle($objArticle, $blnAddArchive, (++$count == 1 ? ' first' : '') . ($count == $limit ? ' last' : '') . ($count % 2 == 0 ? ' odd' : ' even'), $count); } return $arrArticles; }