Beispiel #1
0
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Beispiel #2
0
 public function countVideos($listtype)
 {
     switch ($listtype) {
         case 'featured':
             $featuredDao = IVIDEO_BOL_VideoFeaturedDao::getInstance();
             $query = "\n                    SELECT COUNT(`c`.`id`)       \n                    FROM `" . $this->getTableName() . "` AS `c`\n                    LEFT JOIN `" . $featuredDao->getTableName() . "` AS `f` ON ( `c`.`id` = `f`.`videoId` )\n                    WHERE `c`.`status` = 'approved' AND `c`.`privacy` = 'everybody' AND `f`.`id` IS NOT NULL\n                ";
             return $this->dbo->queryForColumn($query);
             break;
         case 'latest':
             $example = new OW_Example();
             $example->andFieldEqual('status', 'approved');
             $example->andFieldEqual('privacy', 'everybody');
             return $this->countByExample($example);
             break;
         case 'pending':
             $example = new OW_Example();
             $example->andFieldEqual('status', 'pending');
             return $this->countByExample($example);
             break;
     }
 }
 private function __construct()
 {
     $this->videoFeaturedDao = IVIDEO_BOL_VideoFeaturedDao::getInstance();
 }