public function indexAction(Param\AnyString $portfolioLink = null) { if (!is_null($portfolioLink)) { $this->_viewWork($portfolioLink->val()); return; } $mainXml = $this->root->appendChild($this->xml->createElement('PortfolioView')); $this->root->setAttribute('pageTitle', \Difra\Locales::getInstance()->getXPath('portfolio/adm/portfolio')); $search = new \Difra\Unify\Search('PortfolioEntry'); $search->setOrder('release', 'release'); $workList = $search->getList(); $idArray = []; $newYear = 0; foreach ($workList as $work) { $workNode = $mainXml->appendChild($this->xml->createElement('PortfolioEntry')); $work->getXML($workNode); if (!is_null($work->release)) { $xRelease = explode('-', $work->release); if ($newYear != $xRelease[0]) { $workNode->setAttribute('newYear', $xRelease[0]); $newYear = $xRelease[0]; } } $idArray[] = $work->id; } if (!empty($idArray)) { \Difra\Plugins\Portfolio::getMainImagesXML($idArray, $mainXml); } }
public function indexAction() { $search = new \Difra\Unify\Search('PortfolioEntry'); $portfolioNode = $this->root->appendChild($this->xml->createElement('PortfolioEntryList')); $search->setOrder('release', 'release'); $workList = $search->getList(); $idArray = []; if (!is_null($workList)) { foreach ($workList as $work) { $workNode = $portfolioNode->appendChild($this->xml->createElement('PortfolioEntry')); $work->getXML($workNode); $idArray[] = $work->id; } if (!empty($idArray)) { \Difra\Plugins\Portfolio::getMainImagesXML($idArray, $portfolioNode); } } }