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); }
public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
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; } }
public function delete($params) { if (isset($params['id'])) { IVIDEO_BOL_CategoryService::getInstance()->deleteCategory((int) $params['id']); } $this->redirect(OW::getRouter()->urlForRoute('ivideo_categories')); }