BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
EchoUserNotificationGateway Class Reference

Public Member Functions

 __construct (User $user, MWEchoDbFactory $dbFactory)
 
 markRead (array $eventIDs)
 
 markUnRead (array $eventIDs)
 
 markAllRead ()
 
 getCappedNotificationCount ($dbSource, array $eventTypesToLoad=array(), $cap=MWEchoNotifUser::MAX_BADGE_COUNT)
 
 getUnreadNotifications ($type)
 

Protected Attributes

 $dbFactory
 
 $user
 

Static Protected Attributes

static $eventTable = 'echo_event'
 
static $notificationTable = 'echo_notification'
 

Detailed Description

Database gateway which handles direct database interaction with the echo_notification & echo_event for a user, that wouldn't require loading data into models

Constructor & Destructor Documentation

EchoUserNotificationGateway::__construct ( User  $user,
MWEchoDbFactory  $dbFactory 
)
Parameters
User
MWEchoDbFactory

Member Function Documentation

EchoUserNotificationGateway::getCappedNotificationCount (   $dbSource,
array  $eventTypesToLoad = array(),
  $cap = MWEchoNotifUser::MAX_BADGE_COUNT 
)

Get notification count for the types specified

Parameters
int$dbSourceuse master or slave storage to pull count
array$eventTypesToLoadevent types to retrieve
int$capMax count
Returns
int
EchoUserNotificationGateway::getUnreadNotifications (   $type)

IMPORTANT: should only call this function if the number of unread notification is reasonable, for example, unread notification count is less than the max display defined in MWEchoNotifUser::MAX_BADGE_COUNT

Parameters
string
Returns
int[]
EchoUserNotificationGateway::markAllRead ( )

Mark all notification as read, use MWEchoNotifUer::markAllRead() instead

Deprecated:
may need this when running in a job or revive this when we have updateJoin()
EchoUserNotificationGateway::markRead ( array  $eventIDs)

Mark notifications as read

Parameters
$eventIDsarray
Returns
boolean
EchoUserNotificationGateway::markUnRead ( array  $eventIDs)

Mark notifications as unread

Parameters
$eventIDsarray
Returns
boolean

Member Data Documentation

EchoUserNotificationGateway::$eventTable = 'echo_event'
staticprotected

The tables for this gateway


The documentation for this class was generated from the following file: