public function generatePath($route, $notifiable, NotificationInterface $notification = null)
    {
        if ($notifiable instanceof NotifiableInterface) {
            $notifiableId = $this->notificationManager->getNotifiableEntity($notifiable)->getId();
        } elseif ($notifiable instanceof NotifiableEntity) {
            $notifiableId = $notifiable->getId();
        } else {
            throw new InvalidArgumentException('You must provide a NotifiableInterface or NotifiableEntity object');
        }

        switch ($route) {
            case 'notification_list':
                return $this->router->generate(
                    'notification_list',
                    array('notifiable' => $notifiableId)
                );
                break;
            case 'notification_mark_as_seen':
                if (!$notification) {
                    throw new \InvalidArgumentException('You must provide a Notification Entity');
                }

                return $this->router->generate(
                    'notification_mark_as_seen',
                    array(
                        'notifiable' => $notifiableId,
                        'notification' => $notification->getId()
                    )
                );
                break;
            case 'notification_mark_as_unseen':
                if (!$notification) {
                    throw new \InvalidArgumentException('You must provide a Notification Entity');
                }

                return $this->router->generate(
                    'notification_mark_as_unseen',
                    array(
                        'notifiable' => $notifiableId,
                        'notification' => $notification->getId()
                    )
                );
                break;
            case 'notification_mark_all_as_seen':
                return $this->router->generate('notification_mark_all_as_seen', array('notifiable' => $notifiableId));
                break;
            default:
                return new \InvalidArgumentException('You must provide a valid route path. Paths availables : notification_list, notification_mark_as_seen, notification_mark_as_unseen, notification_mark_all_as_seen');
        }
    }
public function generatePath($route, $notifiable, NotificationInterface $notification = null)
    {
        if ($notifiable instanceof NotifiableInterface) {
            $notifiableId = $this->notificationManager->getNotifiableEntity($notifiable)->getId();
        } elseif ($notifiable instanceof NotifiableEntity) {
            $notifiableId = $notifiable->getId();
        } else {
            throw new InvalidArgumentException('You must provide a NotifiableInterface or NotifiableEntity object');
        }

        switch ($route) {
            case 'notification_list':
                return $this->router->generate(
                    'notification_list',
                    array('notifiable' => $notifiableId)
                );
                break;
            case 'notification_mark_as_seen':
                if (!$notification) {
                    throw new \InvalidArgumentException('You must provide a Notification Entity');
                }

                return $this->router->generate(
                    'notification_mark_as_seen',
                    array(
                        'notifiable' => $notifiableId,
                        'notification' => $notification->getId()
                    )
                );
                break;
            case 'notification_mark_as_unseen':
                if (!$notification) {
                    throw new \InvalidArgumentException('You must provide a Notification Entity');
                }

                return $this->router->generate(
                    'notification_mark_as_unseen',
                    array(
                        'notifiable' => $notifiableId,
                        'notification' => $notification->getId()
                    )
                );
                break;
            case 'notification_mark_all_as_seen':
                return $this->router->generate('notification_mark_all_as_seen', array('notifiable' => $notifiableId));
                break;
            default:
                return new \InvalidArgumentException('You must provide a valid route path. Paths availables : notification_list, notification_mark_as_seen, notification_mark_as_unseen, notification_mark_all_as_seen');
        }
    }
public function generatePath ( $ route , $ notifiable , NotificationInterface $ notification = null ) { if ( $ notifiable instanceof NotifiableInterface ) { $ notifiableId = $ this -> notificationManager -> getNotifiableEntity ( $ notifiable ) -> getId ( ) ; } elseif ( $ notifiable instanceof NotifiableEntity ) { $ notifiableId = $ notifiable -> getId ( ) ; } else { throw new InvalidArgumentException ( 'You must provide a NotifiableInterface or NotifiableEntity object' ) ; } switch ( $ route ) { case 'notification_list' : return $ this -> router -> generate ( 'notification_list' , array ( 'notifiable' => $ notifiableId ) ) ; break ; case 'notification_mark_as_seen' : if ( ! $ notification ) { throw new \ InvalidArgumentException ( 'You must provide a Notification Entity' ) ; } return $ this -> router -> generate ( 'notification_mark_as_seen' , array ( 'notifiable' => $ notifiableId , 'notification' => $ notification -> getId ( ) ) ) ; break ; case 'notification_mark_as_unseen' : if ( ! $ notification ) { throw new \ InvalidArgumentException ( 'You must provide a Notification Entity' ) ; } return $ this -> router -> generate ( 'notification_mark_as_unseen' , array ( 'notifiable' => $ notifiableId , 'notification' => $ notification -> getId ( ) ) ) ; break ; case 'notification_mark_all_as_seen' : return $ this -> router -> generate ( 'notification_mark_all_as_seen' , array ( 'notifiable' => $ notifiableId ) ) ; break ; default : return new \ InvalidArgumentException ( 'You must provide a valid route path. Paths availables : notification_list, notification_mark_as_seen, notification_mark_as_unseen, notification_mark_all_as_seen' ) ; } }
Returns the path to the NotificationController action

@param                            $route
@param                            $notifiable
@param NotificationInterface|null $notification

@return \InvalidArgumentException|string
@throws \RuntimeException
@throws \Doctrine\DBAL\Exception\InvalidArgumentException
@throws \Doctrine\ORM\OptimisticLockException
@throws \Doctrine\ORM\ORMInvalidArgumentException
@throws \InvalidArgumentException
Returns the path to the NotificationController action