Elgg\Notifications\SubscriptionsService::addSubscription PHP Метод

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
    public function addSubscription($userGuid, $method, $targetGuid)
    {
        if (!in_array($method, $this->methods)) {
            return false;
        }
        $prefix = self::RELATIONSHIP_PREFIX;
        return add_entity_relationship($userGuid, "{$prefix}{$method}", $targetGuid);
    }