Campustream 1.0
A social network MQP for WPI
notifications Class Reference

Public Member Functions

 __construct ($user=false)
 get ($type, $min=5)
 send ($to_user, $type, $msg, $link_id)
 markAllAsRead ()
 markAsRead ($type)
 numUnread ($type=false)

Static Public Member Functions

static load ()

Data Fields

 $read

Detailed Description

Campustream's notification system, backed by Redis

Definition at line 6 of file notifications.php.


Constructor & Destructor Documentation

__construct ( user = false)

Create a new notifications class and store a connection to Redis for later use.

Definition at line 35 of file notifications.php.


Member Function Documentation

get ( type,
min = 5 
)

Retrieve a certain category of notifications.

Parameters:
$typeThe category to retrieve
$minThe minimum number of notifications to return

Definition at line 53 of file notifications.php.

static load ( ) [static]

Return a singleton instance of this class

Definition at line 23 of file notifications.php.

markAllAsRead ( )

Mark all notifications as read

Definition at line 97 of file notifications.php.

markAsRead ( type)

Mark all notifications of a certain type as read

Parameters:
$typeThe category of notifications

Definition at line 113 of file notifications.php.

numUnread ( type = false)

Retrieve the number of unread notifications, either in a certain category, or across all categories.

Definition at line 136 of file notifications.php.

send ( to_user,
type,
msg,
link_id 
)

Send a notification to the given user.

Parameters:
$to_userThe user to send the notification to
$typeThe category of notification
$msgThe notification message
$link_idThe ID that will be used to link the user to the post

Definition at line 81 of file notifications.php.


Field Documentation

$read

Definition at line 8 of file notifications.php.


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