/** * @see \Hofff\Contao\Selectri\Model\Data::browseFrom() * * @param null $chunks * * @return array * * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ public function browseFrom($chunks = null) { $listData = new SQLListData($this->getWidget(), $this->getDatabase(), $this->prepareListDataConfig($chunks)); list($newsArchiveLevels, $key) = $listData->browseFrom(null); $levels = new \ArrayIterator(); while ($newsArchive = $newsArchiveLevels->current()) { $node = $newsArchive->getData(); $node['_key'] = implode('::', array('tl_news', $node['id'])); $listNode = new SQLListNode($listData, $node); $levels->append($listNode); $newsArchiveLevels->next(); } return array($levels, implode('::', $chunks)); }
/** * @see \Hofff\Contao\Selectri\Model\Data::browseFrom() * * @param null $chunks * * @return array * * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ public function browseFrom($chunks = null) { $listData = new SQLListData($this->getWidget(), $this->getDatabase(), $this->prepareListDataConfig($chunks)); list($eventMonthLevels, $key) = $listData->browseFrom(null); $levels = new \ArrayIterator(); while ($newsArchive = $eventMonthLevels->current()) { $node = $newsArchive->getData(); $node['_isSelectable'] = false; $node['_key'] = implode('::', array_merge($chunks, array('month', $node['month']))); $listNode = new SQLListSelectAbleNode($listData, $node); $levels->append($listNode); $eventMonthLevels->next(); } return array($levels, implode('::', $chunks)); }
/** * Get article for this node. * * @param $pid * * @return string * * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ protected function getArticleNode($pid) { $listData = new SQLListData($this->getData()->getWidget(), Database::getInstance(), $this->getListDataConfig($pid)); list($articleLevel, $start) = $listData->browseFrom(); $level = new \ArrayIterator(); /** @var SQLListNode $current */ while ($current = $articleLevel->current()) { $node = $current->getData(); $node['_key'] = 'tl_article::' . $node['_key']; $listNode = new SQLListNode($listData, $node); $level->append($listNode); $articleLevel->next(); } ob_start(); include Controller::getTemplate('avisota_selectri_with_items'); return ob_get_clean(); }
/** * @see \Hofff\Contao\Selectri\Model\Data::browseFrom() * * @param null $key * * @return array * * @throws SelectriException */ public function browseFrom($key = null) { $listData = new SQLListData($this->getWidget(), $this->getDatabase(), $this->prepareListDataConfig()); list($eventCalendarLevels, $key) = $listData->browseFrom($key); $levels = new \ArrayIterator(); while ($eventCalendar = $eventCalendarLevels->current()) { $node = $eventCalendar->getData(); if ($this->isEmptyCalendar($node)) { $eventCalendarLevels->next(); continue; } $node['_isSelectable'] = false; $node['_key'] = 'tl_calendar::' . $node['_key']; $listNode = new SQLListSelectAbleNode($listData, $node); $levels->append($listNode); $eventCalendarLevels->next(); } return array($levels, $key); }