getFirstname())) . ' ' . strtoupper($user->getLastname()); } // isUserInGroupVip public function isInGroupUserVip(UserInterface $user) { return $this->isInGroupByDevAlias($user, 'vip') ; } // isUserInGroup public function isInGroupUser(UserInterface $user, GroupUserInterface $groupUser) { return $this->isInGroupByDevAlias($user, $groupUser->getDevAlias()); } // isUserInGroupByDevAlias public function isInGroupByDevAlias(UserInterface $user, string $groupUserDevAlias) { $groupUsers = $user->getGroupUsers(); foreach($groupUsers as $groupUser) { if($groupUser->getDevAlias() == $groupUserDevAlias) { return true; } } return false; } public function isSubscribedToNewsletter(UserInterface $user, NewsletterInterface $newsletter) { return $user->getNewsletters()->contains($newsletter); } }