class vB_Library_Notification extends vB_Library

vB_Library_Notification

Traits

Constants

DATASTOREKEY_TRIGGERS

DATASTOREKEY_TYPES

Properties

static protected $instance from vB_Library
protected $assertor DB Assertor object
protected $insertsPerBulk Int Number of rows per assert that insertNotificationsToDB() will insert.
protected $notificationQueue Array[String] An array of queued notifications awaiting DB insert.
protected $fcmQueue
protected $emailQueue Array An array of queued emails This array is built by the various generate{}Notifications() methods, and cleared in sendEmailNotifications().
protected $subscribers

Methods

__sleep()

No description

__wakeup()

No description

__construct()

No description

static vB_PageCache
instance($class)

Returns singleton instance of self.

static 
getLibraryClassNameInternal($controller)

No description

static 
getContentInstance($contenttypeid)

No description

static 
clearCache()

No description

setInsertPerBulk(int $newInsertsPerBulk)

Sets $this->insertsPerBulk, which is the maximum number of rows that insertNotificationsToDB() will insert into the DB in each database assert.

int
getInsertPerBulk()

Returns class variable $insertsPerBulk. Also see setInsertPerBulk()

Array
getNotificationQueue()

Returns the class variable $notificationQueue. Used for testing.

insertNotificationsToDB()

Insert all items in $this->notificationQueue into the database.

processFCMQueue()

No description

deleteNotification(Int|Int[] $notificationids)

Deletes specified notificationds, ignoring ownership

Int
fetchTotalNotificationCountForUser(Int $userid)

Returns the total count of specified user's notifications

Int
fetchNotificationCountForUser(Int $userid, Array $data = array())

Returns the count of specified user's notifications based on provided filterParams

Array
fetchNotificationsForCurrentUser(Array $data = array())

Return current user's notifications from DB.

triggerNotificationEvent($eventstring, $data = array(), $recipients = array())

No description

sendEmailNotifications()

No description

sendEmailNotification($data)

No description

sendLegacyEmailNotification($data)

No description

getDefaultTypes()

No description

insertNotificationTypeToDB($class)

No description

insertNotificationEventsToDB($class)

No description

getNotificationEvents()

No description

getNotificationTypes()

No description

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 113
protected __construct()

in vB_Library at line 35
static vB_PageCache instance($class)

Returns singleton instance of self.

Parameters

$class

Return Value

vB_PageCache
  • Reference to singleton instance of the cache handler

in vB_Library at line 52
static protected getLibraryClassNameInternal($controller)

Parameters

$controller

in vB_Library at line 91
static getContentInstance($contenttypeid)

Parameters

$contenttypeid

in vB_Library at line 99
static clearCache()

at line 126
setInsertPerBulk(int $newInsertsPerBulk)

Sets $this->insertsPerBulk, which is the maximum number of rows that insertNotificationsToDB() will insert into the DB in each database assert.

Set this before calling insertNotificationsToDB() to affect the inserts.

Parameters

int $newInsertsPerBulk Will have no affect if smaller than 1.

at line 139
int getInsertPerBulk()

Returns class variable $insertsPerBulk. Also see setInsertPerBulk()

Return Value

int

at line 150
Array getNotificationQueue()

Returns the class variable $notificationQueue. Used for testing.

Return Value

Array see $notificationQueue

at line 159
insertNotificationsToDB()

Insert all items in $this->notificationQueue into the database.

The actual bulk of this function should probably live in the vBForum querydefs file.

at line 207
protected processFCMQueue()

at line 301
deleteNotification(Int|Int[] $notificationids)

Deletes specified notificationds, ignoring ownership

Parameters

Int|Int[] $notificationids Array of notificationids to delete.

at line 322
Int fetchTotalNotificationCountForUser(Int $userid)

Returns the total count of specified user's notifications

Parameters

Int $userid

Return Value

Int

at line 337
Int fetchNotificationCountForUser(Int $userid, Array $data = array())

Returns the count of specified user's notifications based on provided filterParams

Parameters

Int $userid
Array $data Optional. If not empty, should have - 'typeid'

Return Value

Int

at line 417
Array fetchNotificationsForCurrentUser(Array $data = array())

Return current user's notifications from DB.

Parameters

Array $data Fields - 'sortDir' Optional String sort direction. If not "ASC", sort order will be DESC. The sort field is notification.lastsenttime - 'perpage' Optional unsigned integer results per page. Default is 20 per page. - 'page' Optional unsigned integer page # to return. Default is the first page. - 'showdetail' Optional boolean, set true to display details about node ratings. - 'about' Optional String legacy about string. - 'typename' Optional String Notification typename. If 'about' is set, that will be used instead. If a valid 'about & 'typename' is set, only notifications of that type will be returned. - 'readFilter' Optional String filter by new/dismissed status. If NOT SET, function will default to 'unread_only'. If is SET, the expected values are ('unread_only'| 'read_only'|'*'). If SET but not to 'unread_only' OR 'read_only', function will return both new & dismissed notifications. - 'skipIds' Optional Int[], only used internally by vB_Api_Notification::dismissNotification()

Return Value

Array Keyed by integer notificationid, contains all data from the notification table and possibly the following fields: - 'categoryname' - 'typename' - 'sender_username' - 'sender_avatarpath' For CONTENT category - 'aboutstartertitle' - 'aboutstarterrouteid' - 'otherParticipantsCount' For POLLVOTE category - 'votes' poll.votes for sentbynodeid - 'lastvote' poll.lastvote for sentbynodeid - 'otherVotersCount' For NODEACTION category's NODEACTION_LIKE type: - 'showdetail' Based on user's genericpermissions.canseewholiked permission - 'totalRatersCount' - 'otherRatersCount'

            .. TODO finish this docblock

at line 828
triggerNotificationEvent($eventstring, $data = array(), $recipients = array())

Parameters

$eventstring
$data
$recipients

at line 958
protected sendEmailNotifications()

at line 989
protected sendEmailNotification($data)

Parameters

$data

at line 1032
protected sendLegacyEmailNotification($data)

Parameters

$data

at line 1426
getDefaultTypes()

at line 1454
insertNotificationTypeToDB($class)

Parameters

$class

at line 1501
insertNotificationEventsToDB($class)

Parameters

$class

at line 1584
getNotificationEvents()

at line 1597
protected reloadNotificationEventsFromDB()

at line 1620
getNotificationTypes()

at line 1633
protected reloadNotificationTypesFromDB()