/** * @param integer $eventId * @param integer $userId */ public function hideInvitationByUserId($userId) { $query = "UPDATE `" . EVENT_BOL_EventInviteDao::getInstance()->getTableName() . "` SET `displayInvitation` = false \r\n WHERE `" . EVENT_BOL_EventInviteDao::USER_ID . "` = :userId AND `displayInvitation` = true "; return $this->dbo->update($query, array('userId' => (int) $userId)); }
/** * Constructor. */ private function __construct() { $this->eventDao = EVENT_BOL_EventDao::getInstance(); $this->eventUserDao = EVENT_BOL_EventUserDao::getInstance(); $this->eventInviteDao = EVENT_BOL_EventInviteDao::getInstance(); $this->configs[self::CONF_EVENT_USERS_COUNT] = 10; $this->configs[self::CONF_EVENTS_COUNT_ON_PAGE] = 15; $this->configs[self::CONF_DASH_WIDGET_EVENTS_COUNT] = 3; $this->configs[self::CONF_WIDGET_EVENTS_COUNT] = 3; $this->configs[self::CONF_EVENT_USERS_COUNT_ON_PAGE] = 30; $this->configs[self::CONF_WIDGET_EVENTS_COUNT_OPTION_LIST] = array(3 => 3, 5 => 5, 10 => 10, 15 => 15, 20 => 20); }
/** * @param integer $userId * @return integer */ public function findDisplayedUserInvitationCount($userId) { $query = "SELECT COUNT(*) AS `count` FROM `" . $this->getTableName() . "` AS `e`\n INNER JOIN `" . EVENT_BOL_EventInviteDao::getInstance()->getTableName() . "` AS `ei` ON ( `e`.`id` = `ei`.`" . EVENT_BOL_EventInviteDao::EVENT_ID . "` )\n WHERE `ei`.`" . EVENT_BOL_EventInviteDao::USER_ID . "` = :userId AND `ei`.`displayInvitation` = true AND " . $this->getTimeClause(false, 'e') . " GROUP BY `e`.`id`"; return $this->dbo->queryForColumn($query, array('userId' => (int) $userId, 'startTime' => time(), 'endTime' => time())); }