Beispiel #1
0
 public function findCategoryVideosCount($category)
 {
     $catId = IVIDEO_BOL_CategoryService::getInstance()->getCategoryId($category);
     $categoryDao = IVIDEO_BOL_VideoCategoryDao::getInstance();
     $query = "SELECT COUNT(*) FROM " . $this->getTableName() . " a," . $categoryDao->getTableName() . " b\n                  WHERE a.status = 'approved'\n                    AND a.id = b.videoID\n                    AND a.privacy = 'everybody' \n                    AND b.categoryId = " . $catId;
     return $this->dbo->queryForColumn($query);
 }
Beispiel #2
0
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Beispiel #3
0
 public function getVideoCategories($videoId)
 {
     $example = new OW_Example();
     $example->andFieldEqual('videoId', $videoId);
     $categories = $this->findListByExample($example);
     $list = array();
     foreach ($categories as $category) {
         $list[] = IVIDEO_BOL_CategoryService::getInstance()->getCategoryName($category->categoryId);
     }
     if (count($list) > 0) {
         return $list;
     } else {
         return false;
     }
 }
Beispiel #4
0
 public function delete($params)
 {
     if (isset($params['id'])) {
         IVIDEO_BOL_CategoryService::getInstance()->deleteCategory((int) $params['id']);
     }
     $this->redirect(OW::getRouter()->urlForRoute('ivideo_categories'));
 }