public function wikiAction() { $keyword = $this->dispatcher->getParam('keyword'); $entry = null; $keyword = EntryKeyword::findFirst("keyword='{$keyword}'"); if ($keyword) { $entry = $keyword->entry; } if (!$entry || $entry->status != 'published') { throw new Exception\ResourceNotFoundException('Request entry not found'); } $this->view->setVar('keyword', $keyword); }
public function getEntryByKeyword($keyword) { return EntryKeyword::findFirst(array('keyword' => $keyword)); }