@param bool $subscribed

@return $this
960178
private function filterSubscribed($subscribed = null)
    {
        if ($subscribed === true) {
            $this->subscriptionCollection->addFieldToFilter('subscriber_status', ['eq' => 1]);
        } elseif ($subscribed === false) {
            $this->subscriptionCollection->addFieldToFilter('subscriber_status', ['neq' => 1]);
        }
        return $this;
    }
406993
public function addSubscriber(SubscriberInterface $subscriber)
    {
        foreach ($subscriber->getSubscriberEvents() as $subscriberEvent => $params) {
            if (is_string($params)) {
                $this->addListener($subscriberEvent, array($subscriber, $params));
            }

            if (is_array($params)) {
                foreach ($params as $param) {
                    $this->addListener($subscriberEvent, array($subscriber, $param));
                }
            }
        }
    }
142238
protected function invokeSubscriberByInstance($subscriber, IEvent $event) {
        if (is_object($subscriber) && method_exists($subscriber, 'handle')) {
            $this->invokeSubscriber($subscriber, $event);

            return true;
        }

        return false;
    }
443206
public function addSubscriber(EventSubscriberInterface $subscriber)
    {
        if (!$this->hasSubscriber($subscriber)) {
            $this->subscribers[] = $subscriber;
        }

        return $this;
    }
368573
public function addSubscriber(SubscriberInterface $subscriber): NodeInterface
    {
        $this->_subscribers[$subscriber->getId()] = $subscriber;

        return $this;
    }
689805
private function addSubscribers(array $eventSubscribers)
    {
        foreach ($eventSubscribers as $eventSubscriber) {
            if (is_string($eventSubscriber)) {
                $eventSubscriber = new $eventSubscriber();
            } elseif (is_callable($eventSubscriber)) {
                $eventSubscriber = call_user_func($eventSubscriber, $this->dispatcher);
            }

            $this->dispatcher->addSubscriber($eventSubscriber);
        }

        return $this;
    }
160096
public function removeSubscriber(EventSubscriberInterface $subscriber)
    {
        unset($this->subscribers[array_search($subscriber, $this->subscribers, true)]);
        $this->subscribers = empty($this->subscribers) ? [] : array_values($this->subscribers);

        return $this;
    }
1297662
public function register(GraphQLSubscription $subscription, string $field): self
    {
        $this->subscriptions[$field] = $subscription;

        return $this;
    }
808323
public function setNested(bool $nested = true)
    {
        if ($nested && (null !== $this->collectionName || null !== $this->collectionOptions)) {
            $err = 'Document class "%s" cannot be nested if collection name or collection options had been specified.';

            throw new LogicException(sprintf($err, $this->documentClass));
        }

        $this->nested = $nested;

        return $this;
    }
415661
private function setEventSubscribers(string $eventName, array $eventSubscribers): self
    {
        $this->subscribers[$eventName] = $eventSubscribers;

        return $this;
    }
573535
public function setSubscriber($subscriber)
    {
        $this->_subscriber = $subscriber;

        if ($subscriber->persisted()) {
            $this->actorId = $this->_subscriber->id;
        } else {
            $this->set('actorId', PHP_INT_MAX);
        }

        $this->getRepository()->getSpace()->setSaveOrder($this, $this->_subscriber);

        return $this;
    }
393052
public function addSubscriber(EventSubscriberInterface $subscriber)
    {
        if ($subscriber instanceof HttpClientEventSubscriber) {
            $subscriber->attachHttpClient($this);
        }

        $this->eventDispatcher->addSubscriber($subscriber);
    }
1189915
protected function _authorizeSubscribe($context)
    {
        $entity = $this->_entity;

        if (is_guest($this->_viewer)) {
            return false;
        }

        if (! $entity->isSubscribable()) {
            return false;
        }

        return $this->_viewer->following($entity);
    }
419718
protected function addEventSubscribers(array $subscribers)
  {
    try
    {
      foreach ($subscribers as $subscriber)
      {
        $this->dispatcher->addSubscriber($this->classBuilder->getObjectInstance($subscriber));
      }
    }
    catch (\Exception $e)
    {
      throw new TransformerException($e->getMessage());
    }

    return $this;
  }
459921
public function cancel($immediately = false)
    {
        $this->canceled_at = Carbon::now();

        if ($immediately) {
            $this->canceled_immediately = true;
        }

        if ($this->save()) {
            event(new SubscriptionCanceled($this));

            return $this;
        }

        return false;
    }
425590
public function setRepositorySubscription(bool $subscribed = false, bool $ignored = false): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/subscription?:args',
            $this->getActivity()->getOwner(), $this->getActivity()->getRepo(), http_build_query([
                'subscribed' => $subscribed,
                'ignored'    => $ignored
            ])), Request::METHOD_PUT);
    }
179658
public function addSubscriber(SubscriberInterface $subscriber)
    {
        foreach ($subscriber->getSubscribedEvents() as $eventName => $callable) {
            $this->addListener($eventName, $callable);
        }
    }