/** * @param UuidInterface $object * @return $this */ public function __invoke(UuidInterface $object) { $user = $this->userManager->getUserFromAuthenticator(); $this->object = $object; $this->emailsActive = false; $this->isSubscribed = false; if (!is_object($user)) { return $this; } $this->isSubscribed = $this->subscriptionManager->isUserSubscribed($user, $object); if (!$this->isSubscribed) { return $this; } $subscription = $this->subscriptionManager->findSubscription($user, $object); $this->emailsActive = $subscription->getNotifyMailman(); return $this; }