Example #1
0
 public function showAction()
 {
     $category = $this->getRequest()->getParam('category');
     $tagService = new Service_Tag();
     $this->view->tags = $tagService->getForCategory($category);
     $this->view->category = $category;
 }
Example #2
0
 public function showAction()
 {
     $videoService = new Service_Video();
     $tagService = new Service_Tag();
     $video = $videoService->getByPK($this->getRequest()->getParam('id'));
     if ($video->published != 1) {
         $this->_redirect('/');
     }
     $tags = $tagService->getForVideoId($this->getRequest()->getParam('id'));
     $this->view->tags = $tags;
     $this->view->video = $video;
 }
Example #3
0
 public function getLatest($limit = 5, $published_only = true)
 {
     $db = $this->getDbTable()->getAdapter();
     $tagService = new Service_Tag();
     $select = $db->select()->from($this->getDbTable()->info('name'), array('title', 'id'))->order('title DESC')->limit($limit);
     if ($published_only) {
         $select->where('published = 1');
     }
     $rows = $db->fetchAll($select);
     // fetch the tags for each video
     foreach ($rows as &$video) {
         $video['tags'] = $tagService->getForVideoId($video['id']);
     }
     $results = array();
     foreach ($rows as $row) {
         $results[] = new Model_Video($row);
     }
     return $results;
 }