/** * Callback listener for get node items. * * @return null|string */ public function getItems() { if ($this->node['type'] !== 'regular') { return null; } $dataProvider = new DefaultDataProvider(); $dataProvider->setBaseConfig(array('source' => 'tl_article')); $count = $dataProvider->getCount($dataProvider->getEmptyConfig()->setFilter(array(array('property' => 'pid', 'value' => $this->node['id'], 'operation' => '=')))); if (intval($count) <= 0) { return null; } return $this->getArticleNode($this->node['id']); }
/** * check if calendar is empty. * * @param $node * * @return bool */ protected function isEmptyCalendar($node) { $dataProvider = new DefaultDataProvider(); $dataProvider->setBaseConfig(array('source' => 'tl_calendar_events')); $count = $dataProvider->getCount($dataProvider->getEmptyConfig()->setFilter(array(array('property' => 'pid', 'value' => $node['id'], 'operation' => '=')))); if (intval($count) <= 0) { return true; } return false; }