|
Elgg
Version 2.3
|
Public Member Functions | |
| __construct (Database $db, array $methods=array()) | |
| Constructor. More... | |
| getSubscriptions (NotificationEvent $event) | |
| Get the subscriptions for this notification event. More... | |
| getSubscriptionsForContainer ($container_guid) | |
| Get the subscriptions for the content created inside this container. More... | |
| addSubscription ($userGuid, $method, $targetGuid) | |
| Subscribe a user to notifications about a target entity. More... | |
| removeSubscription ($userGuid, $method, $targetGuid) | |
| Unsubscribe a user to notifications about a target entity. More... | |
Public Attributes | |
| const | RELATIONSHIP_PREFIX = 'notify' |
| Elgg has historically stored subscriptions as relationships with the prefix 'notify'. More... | |
| $methods | |
Protected Member Functions | |
| getSubscriptionRecords ($container_guid) | |
| Get subscription records from the database. More... | |
| getMethodRelationships () | |
| Get the relationship names for notifications. More... | |
Protected Attributes | |
| $db | |
Definition at line 15 of file SubscriptionsService.php.
| Elgg\Notifications\SubscriptionsService::__construct | ( | Database | $db, |
| array | $methods = array() |
||
| ) |
Constructor.
| Database | $db | Database object |
| array | $methods | Notification delivery method names |
Definition at line 37 of file SubscriptionsService.php.
| Elgg\Notifications\SubscriptionsService::addSubscription | ( | $userGuid, | |
| $method, | |||
| $targetGuid | |||
| ) |
Subscribe a user to notifications about a target entity.
This method will return false if the subscription already exists.
| int | $userGuid | The GUID of the user to subscribe to notifications |
| string | $method | The delivery method of the notifications |
| int | $targetGuid | The entity to receive notifications about |
Definition at line 120 of file SubscriptionsService.php.
|
protected |
Get the relationship names for notifications.
Definition at line 175 of file SubscriptionsService.php.
|
protected |
Get subscription records from the database.
Records are an object with two vars: guid and methods with the latter being a comma-separated list of subscription relationship names.
| int | $container_guid | The GUID of the subscription target |
Definition at line 150 of file SubscriptionsService.php.
| Elgg\Notifications\SubscriptionsService::getSubscriptions | ( | NotificationEvent | $event | ) |
Get the subscriptions for this notification event.
The return array is of the form:
array( <user guid> => array('email', 'sms', 'ajax'), );
| NotificationEvent | $event | Notification event |
Definition at line 54 of file SubscriptionsService.php.
| Elgg\Notifications\SubscriptionsService::getSubscriptionsForContainer | ( | $container_guid | ) |
Get the subscriptions for the content created inside this container.
The return array is of the form:
array( <user guid> => array('email', 'sms', 'ajax'), );
| int | $container_guid | GUID of the entity acting as a container |
Definition at line 92 of file SubscriptionsService.php.
| Elgg\Notifications\SubscriptionsService::removeSubscription | ( | $userGuid, | |
| $method, | |||
| $targetGuid | |||
| ) |
Unsubscribe a user to notifications about a target entity.
| int | $userGuid | The GUID of the user to unsubscribe to notifications |
| string | $method | The delivery method of the notifications to stop |
| int | $targetGuid | The entity to stop receiving notifications about |
Definition at line 136 of file SubscriptionsService.php.
|
protected |
Definition at line 29 of file SubscriptionsService.php.
| Elgg\Notifications\SubscriptionsService::$methods |
Definition at line 26 of file SubscriptionsService.php.
| const Elgg\Notifications\SubscriptionsService::RELATIONSHIP_PREFIX = 'notify' |
Elgg has historically stored subscriptions as relationships with the prefix 'notify'.
Definition at line 20 of file SubscriptionsService.php.