PHP 클래스 Elgg\Notifications\SubscriptionsService

부터: 1.9.0
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$methods Array of strings. Delivery names as registered with elgg_register_notification_method()

보호된 프로퍼티들

프로퍼티 타입 설명
$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