Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
NotificationDAO Class Reference
Inheritance diagram for NotificationDAO:
DAO

Public Member Functions

_returnNotificationFromRow ($row)
 
 build (&$notification)
 
 deleteByAssoc ($assocType, $assocId, $userId=null, $type=null, $contextId=null)
 
 deleteById ($notificationId, $userId=null)
 
 deleteObject ($notification)
 
getByAssoc ($assocType, $assocId, $userId=null, $type=null, $contextId=null)
 
getById ($notificationId)
 
getByUserId ($userId, $level=NOTIFICATION_LEVEL_NORMAL, $type=null, $contextId=null, $rangeInfo=null)
 
 getInsertNotificationId ()
 
 getNotificationCount ($read=true, $userId, $contextId=null, $level=NOTIFICATION_LEVEL_NORMAL)
 
 insertObject (&$notification)
 
 newDataObject ()
 
 NotificationDAO ()
 
 setDateRead ($notificationId, $dateRead=null)
 
 transferNotifications ($oldUserId, $newUserId)
 
- Public Member Functions inherited from DAO
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 DAO ($dataSource=null, $callHooks=true)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAffectedRows ()
 
 getDataChangedEvent ($elementId=null, $parentElementId=null)
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getInsertId ($table= '', $id= '', $callHooks=true)
 
 getType ($value)
 
 replace ($table, $arrFields, $keyCols)
 
retrieve ($sql, $params=false, $callHooks=true)
 
retrieveCached ($sql, $params=false, $secsToCache=3600, $callHooks=true)
 
retrieveLimit ($sql, $params=false, $numRows=false, $offset=false, $callHooks=true)
 
retrieveRange ($sql, $params=false, $dbResultRange=null, $callHooks=true)
 
 setCacheDir ()
 
 setDataSource (&$dataSource)
 
 update ($sql, $params=false, $callHooks=true, $dieOnError=true)
 
 updateDataObjectSettings ($tableName, &$dataObject, $idArray)
 

Additional Inherited Members

- Public Attributes inherited from DAO
 $_dataSource
 

Detailed Description

Operations for retrieving and modifying Notification objects.

See Also
Notification

Definition at line 20 of file NotificationDAO.inc.php.

Member Function Documentation

& NotificationDAO::_returnNotificationFromRow (   $row)

Creates and returns an notification object from a row

Parameters
$rowarray
Returns
Notification object

Definition at line 131 of file NotificationDAO.inc.php.

References HookRegistry\call(), DAO\datetimeFromDB(), and newDataObject().

Referenced by getById().

NotificationDAO::build ( $notification)

Inserts or update a notification into notifications table.

Parameters
$notificationNotification
Returns
int

Definition at line 179 of file NotificationDAO.inc.php.

References insertObject(), and DAO\update().

NotificationDAO::deleteByAssoc (   $assocType,
  $assocId,
  $userId = null,
  $type = null,
  $contextId = null 
)

Delete notification(s) by association

Parameters
$assocTypeint
$assocIdint
$userIdint optional
$typeint optional
$contextIdint optional
Returns
boolean

Definition at line 236 of file NotificationDAO.inc.php.

References deleteObject(), and getByAssoc().

NotificationDAO::deleteById (   $notificationId,
  $userId = null 
)

Delete Notification by notification id

Parameters
$notificationIdint
$userIdint
Returns
boolean

Definition at line 201 of file NotificationDAO.inc.php.

References DAO\getAffectedRows(), DAORegistry\getDAO(), and DAO\update().

Referenced by deleteObject().

NotificationDAO::deleteObject (   $notification)

Delete Notification

Parameters
$notificationNotification
Returns
boolean

Definition at line 223 of file NotificationDAO.inc.php.

References deleteById().

Referenced by deleteByAssoc().

& NotificationDAO::getByAssoc (   $assocType,
  $assocId,
  $userId = null,
  $type = null,
  $contextId = null 
)

Retrieve Notifications by assoc. Note that this method will not return fully-fledged notification objects. Use NotificationManager::getNotificationsForUser() to get notifications with URL, and contents

Parameters
$assocTypeint
$assocIdint
$typeint
$contextIdint
Returns
object DAOResultFactory containing matching Notification objects

Definition at line 82 of file NotificationDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteByAssoc().

& NotificationDAO::getById (   $notificationId)

Retrieve Notification by notification id

Parameters
$notificationIdint
Returns
object Notification

Definition at line 33 of file NotificationDAO.inc.php.

References _returnNotificationFromRow(), and DAO\retrieve().

& NotificationDAO::getByUserId (   $userId,
  $level = NOTIFICATION_LEVEL_NORMAL,
  $type = null,
  $contextId = null,
  $rangeInfo = null 
)

Retrieve Notifications by user id Note that this method will not return fully-fledged notification objects. Use NotificationManager::getNotificationsForUser() to get notifications with URL, and contents

Parameters
$userIdint
$levelint
$typeint
$contextIdint
$rangeInfoObject
Returns
object DAOResultFactory containing matching Notification objects

Definition at line 57 of file NotificationDAO.inc.php.

References DAO\retrieveRange().

NotificationDAO::getInsertNotificationId ( )

Get the ID of the last inserted notification

Returns
int

Definition at line 248 of file NotificationDAO.inc.php.

References DAO\getInsertId().

Referenced by insertObject().

NotificationDAO::getNotificationCount (   $read = true,
  $userId,
  $contextId = null,
  $level = NOTIFICATION_LEVEL_NORMAL 
)

Get the number of unread messages for a user

Parameters
$readboolean Whether to check for read (true) or unread (false) notifications
$contextIdint
$userIdint
$levelint
Returns
int

Definition at line 260 of file NotificationDAO.inc.php.

References DAO\retrieve().

NotificationDAO::insertObject ( $notification)

Inserts a new notification into notifications table

Parameters
$notificationobject
Returns
int Notification Id

Definition at line 153 of file NotificationDAO.inc.php.

References DAO\datetimeToDB(), Core\getCurrentDate(), getInsertNotificationId(), and DAO\update().

Referenced by build().

NotificationDAO::newDataObject ( )

Instantiate and return a new data object.

Returns
Notification

Definition at line 122 of file NotificationDAO.inc.php.

Referenced by _returnNotificationFromRow().

NotificationDAO::NotificationDAO ( )

Constructor.

Definition at line 24 of file NotificationDAO.inc.php.

NotificationDAO::setDateRead (   $notificationId,
  $dateRead = null 
)

Retrieve Notifications by notification id

Parameters
$notificationIdint
$dateReaddate
Returns
boolean

Definition at line 104 of file NotificationDAO.inc.php.

References DAO\datetimeToDB(), Core\getCurrentDate(), and DAO\update().

NotificationDAO::transferNotifications (   $oldUserId,
  $newUserId 
)

Transfer the notifications for a user.

Parameters
$oldUserIdint
$newUserIdint

Definition at line 283 of file NotificationDAO.inc.php.

References DAO\update().


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