Notification Class Reference

Inheritance diagram for Notification:
Item MashableInboxInterface CustomFieldsModel RedBeanModel BeanModel ObservableComponent

Public Member Functions

 __toString ()

Static Public Member Functions

static getMashableInboxRulesType ()
static getCountByTypeAndUser ($type, User $user)
static getByTypeAndUser ($type, User $user)
static getByNotificationMessageId ($notificationMessageId)
static deleteByTypeAndUser ($type, User $user)
static deleteNotificationAndRelatedNotificationMessage (Notification $notification)
static getCountByUser (User $user)
static getDefaultMetadata ()
static isTypeDeletable ()
static getModuleClassName ()

Static Protected Member Functions

static translatedAttributeLabels ($language)

Detailed Description

A class for creating notification models.

Definition at line 40 of file Notification.php.


Member Function Documentation

__toString (  ) 

Returns the displayable string for the class. Should be overridden in any model that can provide a meaningful string representation of itself.

Returns:
A string.

Reimplemented from RedBeanModel.

Definition at line 47 of file Notification.php.

static getCountByTypeAndUser ( type,
User user 
) [static]

Given a type and a user, find out how many existing notifications exist for that user and that type.

Parameters:
string $type
User $user
Returns:
int

Definition at line 71 of file Notification.php.

static getByTypeAndUser ( type,
User user 
) [static]
Parameters:
$type 
User $user
Returns:
Array of models

Definition at line 82 of file Notification.php.

static getByNotificationMessageId ( notificationMessageId  )  [static]

Get all notifications based on notificationMessage id

Parameters:
$notificationMessageId 
Returns:
Array of models

Definition at line 112 of file Notification.php.

static deleteByTypeAndUser ( type,
User user 
) [static]

Delete all notifications and related NotificationMessages by type and user

Parameters:
$type 
User $user

Definition at line 136 of file Notification.php.

static deleteNotificationAndRelatedNotificationMessage ( Notification notification  )  [static]

Delete notification and related notificationMessage, if there are no relations from other notifications to this notificationMessage

Parameters:
Notification $notification

Definition at line 153 of file Notification.php.

static getDefaultMetadata (  )  [static]

Returns the default meta data for the class. It must be appended to the meta data from the parent model, if any.

Reimplemented from Item.

Definition at line 190 of file Notification.php.

static isTypeDeletable (  )  [static]

To be overriden on intermediate derived classes to return false so that deletes are not done on intermediate classes because the object relational mapping will not clean up properly. For example if User is a Person, and Person is a RedBeanModel delete should be called only on User, not on Person. So User must override isDeletable to return false.

Reimplemented from Item.

Definition at line 223 of file Notification.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Thu Dec 14 07:10:26 2017