Esempio n. 1
0
/**
 * Unsubscribe a user to notifications about a target entity
 *
 * @param int    $user_guid   The GUID of the user to unsubscribe to notifications
 * @param string $method      The delivery method of the notifications to stop
 * @param int    $target_guid The entity to stop receiving notifications about
 * @return bool
 * @since 1.9
 */
function elgg_remove_subscription($user_guid, $method, $target_guid)
{
    $methods = _elgg_services()->notifications->getMethods();
    $db = _elgg_services()->db;
    $subs = new \Elgg\Notifications\SubscriptionsService($db, $methods);
    return $subs->removeSubscription($user_guid, $method, $target_guid);
}