PHP Класс Elgg\Notifications\SubscriptionsService

С версии: 1.9.0
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$methods Array of strings. Delivery names as registered with elgg_register_notification_method()

Защищенные свойства (Protected)

Свойство Тип Описание
$db Elgg\Database

Открытые методы

Метод Описание
__construct ( Database $db, array $methods = [] ) Constructor
addSubscription ( integer $userGuid, string $method, integer $targetGuid ) : boolean Subscribe a user to notifications about a target entity
getSubscriptions ( Elgg\Notifications\NotificationEvent $event ) : array Get the subscriptions for this notification event
getSubscriptionsForContainer ( integer $container_guid ) : array Get the subscriptions for the content created inside this container.
removeSubscription ( integer $userGuid, string $method, integer $targetGuid ) : boolean Unsubscribe a user to notifications about a target entity

Защищенные методы

Метод Описание
getMethodRelationships ( ) : array Get the relationship names for notifications
getSubscriptionRecords ( integer $container_guid ) : array Get subscription records from the database

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Database $db, array $methods = [] )
$db Elgg\Database Database object
$methods array Notification delivery method names

addSubscription() публичный Метод

This method will return false if the subscription already exists.
public addSubscription ( integer $userGuid, string $method, integer $targetGuid ) : boolean
$userGuid integer The GUID of the user to subscribe to notifications
$method string The delivery method of the notifications
$targetGuid integer The entity to receive notifications about
Результат boolean

getMethodRelationships() защищенный Метод

Get the relationship names for notifications
protected getMethodRelationships ( ) : array
Результат array

getSubscriptionRecords() защищенный Метод

Records are an object with two vars: guid and methods with the latter being a comma-separated list of subscription relationship names.
protected getSubscriptionRecords ( integer $container_guid ) : array
$container_guid integer The GUID of the subscription target
Результат array

getSubscriptions() публичный Метод

The return array is of the form: array( => array('email', 'sms', 'ajax'), );
public getSubscriptions ( Elgg\Notifications\NotificationEvent $event ) : array
$event Elgg\Notifications\NotificationEvent Notification event
Результат array

getSubscriptionsForContainer() публичный Метод

The return array is of the form: array( => array('email', 'sms', 'ajax'), );
public getSubscriptionsForContainer ( integer $container_guid ) : array
$container_guid integer GUID of the entity acting as a container
Результат array User GUIDs (keys) and their subscription types (values).

removeSubscription() публичный Метод

Unsubscribe a user to notifications about a target entity
public removeSubscription ( integer $userGuid, string $method, integer $targetGuid ) : boolean
$userGuid integer The GUID of the user to unsubscribe to notifications
$method string The delivery method of the notifications to stop
$targetGuid integer The entity to stop receiving notifications about
Результат boolean

Описание свойств

$db защищенное свойство

protected Database,Elgg $db
Результат Elgg\Database

$methods публичное свойство

Array of strings. Delivery names as registered with elgg_register_notification_method()
public $methods