/** * @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)); }
/** * Class constructor * */ protected function __construct() { $this->groupDao = GROUPS_BOL_GroupDao::getInstance(); $this->groupUserDao = GROUPS_BOL_GroupUserDao::getInstance(); $this->inviteDao = GROUPS_BOL_InviteDao::getInstance(); }