Example #1
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_ComponentDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Example #2
0
 public function findListBySection($placeId, $section)
 {
     $componentDao = BOL_ComponentDao::getInstance();
     $componentSectionDao = BOL_ComponentPositionDao::getInstance();
     $query = '
         SELECT `c`.*, `cp`.`id`, `cp`.`componentId`, `cp`.`clone`, `cp`.`uniqName`, `p`.`order`  FROM `' . $this->getTableName() . '` AS `cp`
             INNER JOIN `' . $componentDao->getTableName() . '` AS `c` ON `cp`.`componentId` = `c`.`id`
             INNER JOIN `' . $componentSectionDao->getTableName() . '` AS `p` 
                 ON `p`.`componentPlaceUniqName` = `cp`.`uniqName`
                 WHERE `cp`.`placeId`=? AND `p`.`section`=?
     ';
     return $this->dbo->queryForList($query, array($placeId, $section));
 }
 public function findComponentListByIdList(array $componentIds)
 {
     $componentDao = BOL_ComponentDao::getInstance();
     $query = '
 		SELECT `c`.*, cp.`id`  FROM `' . $this->getTableName() . '` AS `cp`
 			INNER JOIN `' . $componentDao->getTableName() . '` AS `c` ON `cp`.`componentId` = `c`.`id`
 				WHERE `cp`.`componentId` IN (' . implode(', ', $componentIds) . ')
 	';
     return $this->dbo->queryForColumnList($query, array($placeId));
 }
Example #4
0
 public function findByPluginKey($key)
 {
     return $this->componentDao->findByPluginKey($key);
 }