@@ 114-119 (lines=6) @@ | ||
111 | * @return bool |
|
112 | * @since 1.9 |
|
113 | */ |
|
114 | function elgg_add_subscription($user_guid, $method, $target_guid) { |
|
115 | $methods = _elgg_services()->notifications->getMethods(); |
|
116 | $db = _elgg_services()->db; |
|
117 | $subs = new \Elgg\Notifications\SubscriptionsService($db, $methods); |
|
118 | return $subs->addSubscription($user_guid, $method, $target_guid); |
|
119 | } |
|
120 | ||
121 | /** |
|
122 | * Unsubscribe a user to notifications about a target entity |
|
@@ 130-135 (lines=6) @@ | ||
127 | * @return bool |
|
128 | * @since 1.9 |
|
129 | */ |
|
130 | function elgg_remove_subscription($user_guid, $method, $target_guid) { |
|
131 | $methods = _elgg_services()->notifications->getMethods(); |
|
132 | $db = _elgg_services()->db; |
|
133 | $subs = new \Elgg\Notifications\SubscriptionsService($db, $methods); |
|
134 | return $subs->removeSubscription($user_guid, $method, $target_guid); |
|
135 | } |
|
136 | ||
137 | /** |
|
138 | * Get the subscriptions for the content created inside this container. |
|
@@ 151-156 (lines=6) @@ | ||
148 | * @since 1.9 |
|
149 | * @todo deprecate once new subscriptions system has been added |
|
150 | */ |
|
151 | function elgg_get_subscriptions_for_container($container_guid) { |
|
152 | $methods = _elgg_services()->notifications->getMethods(); |
|
153 | $db = _elgg_services()->db; |
|
154 | $subs = new \Elgg\Notifications\SubscriptionsService($db, $methods); |
|
155 | return $subs->getSubscriptionsForContainer($container_guid); |
|
156 | } |
|
157 | ||
158 | /** |
|
159 | * Queue a notification event for later handling |