コード例 #1
0
ファイル: invite_dao.php プロジェクト: vazahat/dudex
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return GROUPS_BOL_InviteDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
コード例 #2
0
ファイル: service.php プロジェクト: vazahat/dudex
 public function findInvitedUserIdList($groupId, $inviterId)
 {
     $list = $this->inviteDao->findListByGroupIdAndInviterId($groupId, $inviterId);
     $out = array();
     foreach ($list as $item) {
         $out[] = $item->userId;
     }
     return $out;
 }
コード例 #3
0
ファイル: group_dao.php プロジェクト: vazahat/dudex
 /**
  * @param integer $userId
  * @return integer
  */
 public function findUserInvitedGroupsCount($userId, $newOnly = false)
 {
     $addWhere = $newOnly ? 'i.viewed=0' : '1';
     $query = "SELECT COUNT(DISTINCT g.id) AS `count` FROM `" . $this->getTableName() . "` AS `g`\n            INNER JOIN `" . GROUPS_BOL_InviteDao::getInstance()->getTableName() . "` AS `i` ON ( `g`.`id` = `i`.`groupId` )\n            WHERE `i`.`userId` = :u AND " . $addWhere;
     return $this->dbo->queryForColumn($query, array('u' => (int) $userId));
 }