/**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return ADS_BOL_BannerLocationDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Beispiel #2
0
 public function findPlaceBannerList($pluginKey, $position, $location = null)
 {
     $query = "SELECT `b`.* FROM `" . $this->getTableName() . "` AS `b`\n            LEFT JOIN `" . ADS_BOL_BannerPositionDao::getInstance()->getTableName() . "` AS `bp` ON (`b`.`id` = `bp`.`" . ADS_BOL_BannerPositionDao::BANNER_ID . "`)\n            LEFT JOIN `" . ADS_BOL_BannerLocationDao::getInstance()->getTableName() . "` AS `bl` ON (`b`.`id` = `bl`.`" . ADS_BOL_BannerLocationDao::BANNER_ID . "`)\n            WHERE `bp`.`" . ADS_BOL_BannerPositionDao::POSITION . "` = :position AND `bp`.`" . ADS_BOL_BannerPositionDao::PLUGIN_KEY . "` IN ( :pluginKey, 'base' )\n                AND ( `bl`.`" . ADS_BOL_BannerLocationDao::LOCATION . "` IS NULL" . ($location === null ? ')' : " OR `bl`.`" . ADS_BOL_BannerLocationDao::LOCATION . "` = :location)");
     $params = array('pluginKey' => $pluginKey, 'position' => $position);
     if ($location != null) {
         $params['location'] = $location;
     }
     return $this->dbo->queryForObjectList($query, $this->getDtoClassName(), $params, 3600 * 24, array(self::CACHE_TAG_ADS_BANNERS, OW_CacheManager::TAG_OPTION_INSTANT_LOAD));
 }
Beispiel #3
0
 public function deleteBanner($bannerId)
 {
     $this->bannerDao->deleteById($bannerId);
     $this->bannerLocationDao->deleteByBannerId($bannerId);
     $this->bannerPositionDao->deleteByBannerId($bannerId);
 }