src/PHPDish/Bundle/CoreBundle/Util/NotificationHelper.php
public function createFollowCategoryNotification(CategoryInterface $category, UserInterface $follower)
    {
        if ($category->isBook()) {
            $notification = $this->notificationManager->createNotification(
                $this->translator->trans('notification.follow_book.subject', [
                    '%userUrl%' => $this->router->generate('user_view', ['username' => $follower->getUsername()]),
                    '%username%' => $follower->getUsername(),
                    '%bookUrl%' => $this->router->generate('book_view', ['slug' => $category->getSlug()]),
                    '%bookTitle%' => $category->getName()
                ])
            );
        } else {
            $notification = $this->notificationManager->createNotification(
                $this->translator->trans('notification.follow_category.subject', [
                    '%userUrl%' => $this->router->generate('user_view', ['username' => $follower->getUsername()]),
                    '%username%' => $follower->getUsername(),
                    '%categoryUrl%' => $this->router->generate('category_view', ['slug' => $category->getSlug()]),
                    '%categoryTitle%' => $category->getName()
                ])
            );
        }
        $notification->addParameters([
            'subject' => Notification::SUBJECT_FOLLOW_CATEGORY,
            'category_id' => $category->getId(),
            'follower_id' => $follower->getId(),
            'follower_username' => $follower->getUsername(),
        ]);
        return $notification;
    }
public function createFollowCategoryNotification(CategoryInterface $category, UserInterface $follower)
    {
        if ($category->isBook()) {
            $notification = $this->notificationManager->createNotification(
                $this->translator->trans('notification.follow_book.subject', [
                    '%userUrl%' => $this->router->generate('user_view', ['username' => $follower->getUsername()]),
                    '%username%' => $follower->getUsername(),
                    '%bookUrl%' => $this->router->generate('book_view', ['slug' => $category->getSlug()]),
                    '%bookTitle%' => $category->getName()
                ])
            );
        } else {
            $notification = $this->notificationManager->createNotification(
                $this->translator->trans('notification.follow_category.subject', [
                    '%userUrl%' => $this->router->generate('user_view', ['username' => $follower->getUsername()]),
                    '%username%' => $follower->getUsername(),
                    '%categoryUrl%' => $this->router->generate('category_view', ['slug' => $category->getSlug()]),
                    '%categoryTitle%' => $category->getName()
                ])
            );
        }
        $notification->addParameters([
            'subject' => Notification::SUBJECT_FOLLOW_CATEGORY,
            'category_id' => $category->getId(),
            'follower_id' => $follower->getId(),
            'follower_username' => $follower->getUsername(),
        ]);
        return $notification;
    }
{@inheritdoc}