Elgg  Version 6.2
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
Elgg\Notifications\MentionsEventHandler Class Reference

Mentions notification handler. More...

Inheritance diagram for Elgg\Notifications\MentionsEventHandler:
Elgg\Notifications\NotificationEventHandler

Public Member Functions

 getSubscriptions ()
 {Returns subscriptions for the event.
Returns
array
} More...
 
- Public Member Functions inherited from Elgg\Notifications\NotificationEventHandler
 __construct (NotificationEvent $event, NotificationsService $service, array $params=[])
 Constructor. More...
 
 send ()
 Process the event. More...
 
 getMethods ()
 Returns methods to be used for this notification. More...
 

Protected Member Functions

 getNotificationSubject (\ElggUser $recipient, string $method)
 {Get subject for the notification.Plugins can define a subtype specific subject simply by providing a translation for the string "notification:<action>:<type>:<subtype>:subject".
Parameters
\ElggUser$recipientNotification recipient
string$methodMethod
Returns
string Notification subject in the recipient's language
} More...
 
 getNotificationBody (\ElggUser $recipient, string $method)
 {Get body for the notification.Plugin can define a subtype specific body simply by providing a translation for the string "notification:<action>:<type>:<subtype>:body".The arguments passed into the translation are:

  1. Recipient's name
  2. Name of the user who triggered the notification
  3. Title of the content
  4. Name of the content's container
  5. The actual content (entity's 'description' field)
  6. URL to the content
Argument swapping can be used to change the order of the parameters. See http://php.net/manual/en/function.sprintf.php#example-5427
Parameters
\ElggUser$recipientNotification recipient
string$methodMethod
Returns
string Notification body in the recipient's language
} More...
 
 addMuteLink ()
 {Add a mute link in the email notification.
Returns
bool
} More...
 
 getMetadataFields ()
 Get the metadata fields to check for mentions. More...
 
 getMentions ()
 Get usernames which are mentioned in the configured metadata fields. More...
 
 filterMentions (array $mentions)
 Filter mentions. More...
 
- Protected Member Functions inherited from Elgg\Notifications\NotificationEventHandler
 prepareSubscriptions ()
 Returns subscriptions. More...
 
 filterMutedSubscriptions ()
 Should muted subscribers be filtered. More...
 
 getNotificationSubsciptionExclusionGUIDs ()
 Get an array of GUIDs to not get the subscription records for. More...
 
 excludeOwnerSubscribers ()
 Exclude the NotificationEvent object owner_guid when fetching the subscription records for this notification. More...
 
 excludeContainerSubscribers ()
 Exclude the NotificationEvent object container_guid when fetching the subscription records for this notification. More...
 
 excludeEntitySubscribers ()
 Exclude the NotificationEvent object guid when fetching the subscription records for this notification. More...
 
 sendNotifications (array $subscriptions, array $params=[])
 Sends the notifications based on subscriptions. More...
 
 sendNotification (int $guid, string $method, array $params=[])
 Send a notification to a subscriber. More...
 
 deliverNotification (Notification $notification, string $method)
 Deliver a notification. More...
 
 prepareNotification (array $params)
 Prepares a notification for delivery. More...
 
 getNotificationSummary (\ElggUser $recipient, string $method)
 Return the summary for a notification. More...
 
 getNotificationURL (\ElggUser $recipient, string $method)
 Returns the url related to this notification. More...
 
 getEventActor ()
 Get the acting user from the notification event. More...
 
 getEventEntity ()
 Get the entity from the notification event. More...
 

Static Protected Member Functions

static isConfigurableForUser (\ElggUser $user)
 {Can this event be configured for a specific user.
Parameters
\ElggUser$userthe user to check for
Returns
bool
Since
4.1
} More...
 
static isConfigurableForGroup (\ElggGroup $group)
 {Can this event be configured for a specific group.For example this can be based on a group tools option which is enabled or not
Parameters
\ElggGroup$groupthe group to check for
Returns
bool
Since
4.1
} More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Elgg\Notifications\NotificationEventHandler
static isConfigurableByUser ()
 Is this event configurable by the user on the notification settings page. More...
 
static isConfigurableForEntity (\ElggEntity $entity)
 Can this event be configured for a specific entity. More...
 
- Protected Attributes inherited from Elgg\Notifications\NotificationEventHandler
 $event
 
 $service
 
 $params = []
 

Detailed Description

Mentions notification handler.

Since
5.0

Definition at line 12 of file MentionsEventHandler.php.

Member Function Documentation

◆ addMuteLink()

Elgg\Notifications\MentionsEventHandler::addMuteLink ( )
protected

{Add a mute link in the email notification.

Returns
bool
}

Reimplemented from Elgg\Notifications\NotificationEventHandler.

Definition at line 110 of file MentionsEventHandler.php.

◆ filterMentions()

Elgg\Notifications\MentionsEventHandler::filterMentions ( array  $mentions)
protected

Filter mentions.

  • previous detected mentions
Parameters
array$mentionsthe detected mentions from the text
Returns
array

Definition at line 188 of file MentionsEventHandler.php.

◆ getMentions()

Elgg\Notifications\MentionsEventHandler::getMentions ( )
protected

Get usernames which are mentioned in the configured metadata fields.

Returns
string[]

Definition at line 128 of file MentionsEventHandler.php.

◆ getMetadataFields()

Elgg\Notifications\MentionsEventHandler::getMetadataFields ( )
protected

Get the metadata fields to check for mentions.

Returns
string[]

Definition at line 119 of file MentionsEventHandler.php.

◆ getNotificationBody()

Elgg\Notifications\MentionsEventHandler::getNotificationBody ( \ElggUser  $recipient,
string  $method 
)
protected

{Get body for the notification.Plugin can define a subtype specific body simply by providing a translation for the string "notification:<action>:<type>:<subtype>:body".The arguments passed into the translation are:

  1. Recipient's name
  2. Name of the user who triggered the notification
  3. Title of the content
  4. Name of the content's container
  5. The actual content (entity's 'description' field)
  6. URL to the content
Argument swapping can be used to change the order of the parameters. See http://php.net/manual/en/function.sprintf.php#example-5427
Parameters
\ElggUser$recipientNotification recipient
string$methodMethod
Returns
string Notification body in the recipient's language
}

Reimplemented from Elgg\Notifications\NotificationEventHandler.

Definition at line 78 of file MentionsEventHandler.php.

◆ getNotificationSubject()

Elgg\Notifications\MentionsEventHandler::getNotificationSubject ( \ElggUser  $recipient,
string  $method 
)
protected

{Get subject for the notification.Plugins can define a subtype specific subject simply by providing a translation for the string "notification:<action>:<type>:<subtype>:subject".

Parameters
\ElggUser$recipientNotification recipient
string$methodMethod
Returns
string Notification subject in the recipient's language
}

Reimplemented from Elgg\Notifications\NotificationEventHandler.

Definition at line 66 of file MentionsEventHandler.php.

◆ getSubscriptions()

Elgg\Notifications\MentionsEventHandler::getSubscriptions ( )

{Returns subscriptions for the event.

Returns
array
}

Reimplemented from Elgg\Notifications\NotificationEventHandler.

Definition at line 17 of file MentionsEventHandler.php.

◆ isConfigurableForGroup()

static Elgg\Notifications\MentionsEventHandler::isConfigurableForGroup ( \ElggGroup  $group)
staticprotected

{Can this event be configured for a specific group.For example this can be based on a group tools option which is enabled or not

Parameters
\ElggGroup$groupthe group to check for
Returns
bool
Since
4.1
}

Reimplemented from Elgg\Notifications\NotificationEventHandler.

Definition at line 103 of file MentionsEventHandler.php.

◆ isConfigurableForUser()

static Elgg\Notifications\MentionsEventHandler::isConfigurableForUser ( \ElggUser  $user)
staticprotected

{Can this event be configured for a specific user.

Parameters
\ElggUser$userthe user to check for
Returns
bool
Since
4.1
}

Reimplemented from Elgg\Notifications\NotificationEventHandler.

Definition at line 96 of file MentionsEventHandler.php.


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