/** * Returns an instance of class (singleton pattern implementation). * * @return BOL_Search */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
public function deleteExpireSearchResult() { $list = $this->searchDao->findExpireSearchId(); if (!empty($list)) { $this->searchResultDao->deleteSearchResultItems($list); $this->searchDao->deleteByIdList($list); } }
/** * Return search result item count * * @param int $listId * @param int $first * @param int $count * return array */ public function getUserIdList($listId, $first, $count, $excludeList = array()) { $example = new OW_Example(); $example->andFieldEqual('searchId', (int) $listId); $example->setOrder(' sortOrder '); $example->setLimitClause($first, $count); if (!empty($excludeList)) { $example->andFieldNotInArray('userId', $excludeList); } $results = BOL_SearchResultDao::getInstance()->findListByExample($example); $userIdList = array(); foreach ($results as $result) { $userIdList[] = $result->userId; } return $userIdList; }