/**
  * Class constructor
  */
 private function __construct()
 {
     $this->sectionDao = FORUM_BOL_SectionDao::getInstance();
     $this->groupDao = FORUM_BOL_GroupDao::getInstance();
     $this->topicDao = FORUM_BOL_TopicDao::getInstance();
     $this->postDao = FORUM_BOL_PostDao::getInstance();
     $this->userDao = BOL_UserDao::getInstance();
 }
Example #2
0
 public function findTemporaryTopicList($limit)
 {
     $postDao = FORUM_BOL_PostDao::getInstance();
     $query = "SELECT `t`.* FROM `" . $this->getTableName() . "` AS `t`\n            LEFT JOIN `" . $postDao->getTableName() . "` AS `p` ON (`t`.`lastPostId`=`p`.`id`)\n            WHERE `t`.`temp` = 1 AND `p`.`createStamp` < :ts";
     return $this->dbo->queryForList($query, array('ts' => time() - 3600 * 24 * 5));
 }
Example #3
0
 public function getAttachmentsCountByTopicIdList($topicIds)
 {
     $postDao = FORUM_BOL_PostDao::getInstance();
     $query = "\n            SELECT `p`.`topicId`, COUNT(*) AS `attachments`\n            FROM `" . $this->getTableName() . "` AS `a`\n            LEFT JOIN `" . $postDao->getTableName() . "` AS `p` ON (`a`.`postId`=`p`.`id`)\n            WHERE `p`.`topicId` IN (" . $this->dbo->mergeInClause($topicIds) . ")\n            GROUP BY `topicId`\n        ";
     return $this->dbo->queryForList($query);
 }