/** * Returns an instance of class (singleton pattern implementation). * * @return BOL_UserOnlineDao */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
public function unblock($userId) { if (!$this->isBlocked($userId)) { return; } $dto = $this->userBlockDao->findBlockedUser(OW::getUser()->getId(), $userId); $this->userBlockDao->delete($dto); $event = new OW_Event(OW_EventManager::ON_USER_UNBLOCK, array('userId' => OW::getUser()->getId(), 'blockedUserId' => $userId)); OW::getEventManager()->trigger($event); }
private function isBlockedByUserIdList($userId, $userIdList) { $userIdListString = OW::getDbo()->mergeInClause($userIdList); $sql = "SELECT `userId` FROM `" . BOL_UserBlockDao::getInstance()->getTableName() . "` WHERE `blockedUserId` = :userId AND `userId` IN ( {$userIdListString} )"; return OW::getDbo()->queryForList($sql, array('userId' => $userId)); }