CommentsNotificationUtil Class Reference

Inheritance diagram for CommentsNotificationUtil:
NotificationsUtil

Static Public Member Functions

static submitNotificationMessage (OwnedSecurableItem $model, $action, Comment $comment)
static getEmailMessageContent (OwnedSecurableItem $model, $action, User $relatedUser=null)
static getEmailMessageContentSecondPart ($action, Comment $comment=null, $type=null)
static resolvePeopleToSendNotification (OwnedSecurableItem $model, $action, User $relatedUser=null)
static hasPersonHaveRightsAndPermissionsToAccessModelAndIsUserActive (OwnedSecurableItem $model, User $user)

Data Fields

const COMMENT_CREATED_OR_UPDATED = 'CommentCreatedOrUpdated'
const COMMENT_DELETED = 'CommentDeleted'

Static Protected Member Functions

static getNotificationMessageByAction (OwnedSecurableItem $model, $action, Comment $comment=null)
static resolveAndGetNotifications (NotificationMessage $message, NotificationRules $rules)
static processSubscriberNotification (NotificationMessage $message, NotificationRules $rule, $action)
static sendNotificationEmail (Notification $notification, NotificationRules $rule, $action)
static resolveNotificationRulesClassByModelAndAction (OwnedSecurableItem $model, $action)

Detailed Description

Helper class for working with comments notifications

Definition at line 40 of file CommentsNotificationUtil.php.


Member Function Documentation

static submitNotificationMessage ( OwnedSecurableItem model,
action,
Comment comment 
) [static]

Submit comment notification message

Parameters:
OwnedSecurableItem $model
$action 
Comment $comment
Exceptions:
NotFoundException 

Definition at line 53 of file CommentsNotificationUtil.php.

static getNotificationMessageByAction ( OwnedSecurableItem model,
action,
Comment comment = null 
) [static, protected]

Get notification message by action

Parameters:
OwnedSecurableItem $model
$action 
Comment|null $comment
Returns:
NotificationMessage

Definition at line 82 of file CommentsNotificationUtil.php.

static resolveAndGetNotifications ( NotificationMessage message,
NotificationRules rules 
) [static, protected]

Resolve and get notifications

Parameters:
NotificationMessage $message
$rules 
Exceptions:
NotSupportedException 
Returns:
Notification

Reimplemented from NotificationsUtil.

Definition at line 135 of file CommentsNotificationUtil.php.

static processSubscriberNotification ( NotificationMessage message,
NotificationRules rule,
action 
) [static, protected]

Process subscribers notifications

Parameters:
NotificationMessage $message
NotificationRules $rule
$action 

Definition at line 169 of file CommentsNotificationUtil.php.

static sendNotificationEmail ( Notification notification,
NotificationRules rule,
action 
) [static, protected]

Send email

Parameters:
Notification $notification
NotificationRules $rule
string $action

Definition at line 194 of file CommentsNotificationUtil.php.

static getEmailMessageContent ( OwnedSecurableItem model,
action,
User relatedUser = null 
) [static]

Gets email message for the notification

Parameters:
OwnedSecurableItem $model
string $action
User|null $relatedUser
Returns:
string

Definition at line 227 of file CommentsNotificationUtil.php.

static getEmailMessageContentSecondPart ( action,
Comment comment = null,
type = null 
) [static]

Get comment model content

Parameters:
$action 
Comment $comment
Returns:
string

Definition at line 246 of file CommentsNotificationUtil.php.

static resolveNotificationRulesClassByModelAndAction ( OwnedSecurableItem model,
action 
) [static, protected]

Resolve the notification rules class name by action name

Parameters:
$action 
Returns:
string
Exceptions:
NotFoundException 

Definition at line 269 of file CommentsNotificationUtil.php.

static resolvePeopleToSendNotification ( OwnedSecurableItem model,
action,
User relatedUser = null 
) [static]

Gets notification subscribers

Parameters:
OwnedSecurableItem $model
$action 
User|null $relatedUser
Returns:
array

Definition at line 288 of file CommentsNotificationUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Tue Jul 23 07:10:57 2019