Get the identifier mapping for a NotifiableEntity

@param NotifiableEntity $notifiableEntity

@return array
@throws \RuntimeException
@throws \InvalidArgumentException
359424
public function getNotifiableEntityIdentifiers(NotifiableEntity $notifiableEntity)
    {
        $discoveryNotifiables = $this->getDiscoveryNotifiables();
        foreach ($discoveryNotifiables as $notifiable) {
            if ($notifiable['class'] === $notifiableEntity->getClass()) {
                return $notifiable['identifiers'];
            }
        }
        throw new \RuntimeException('Unable to get the NotifiableEntity identifiers. This could be an Entity mapping issue');
    }
815239
public function toMail($notifiable)
    {
        $url = route('auth.activation.activate', [$notifiable->getActivationToken()->token]);

        return (new MailMessage)
            ->greeting('Thanks for registering!')
            ->line('Please click the button below to verify your account.')
            ->action('Verify your email', $url)
            ->line('Thank you for using our application!');
    }
623949
public function send($notifiable, LaravelNotification $notification)
    {
        $entity = $this->getEntity($notifiable, $notification);

        if ($channel = $notifiable->routeNotificationFor('doctrine')) {
            $em = $this->registry->getManager($channel);
        } else {
            $em = $this->registry->getManagerForClass(get_class($entity));
        }

        if (is_null($em)) {
            throw new NoEntityManagerFound;
        }

        $em->persist($entity);
        $em->flush();
    }
1048069
public function listAction($notifiable)
    {
        $notifiableRepo = $this->get('doctrine.orm.entity_manager')->getRepository('MgiletNotificationBundle:NotifiableNotification');
        $notificationList = $notifiableRepo->findAllForNotifiableId($notifiable);
        return $this->render('@MgiletNotification/notifications.html.twig', array(
            'notificationList' => $notificationList,
            'notifiableNotifications' => $notificationList // deprecated: alias for backward compatibility only
        ));
    }
1115628
public function toMail($notifiable)
    {
        $content = trans('notifications.incident.new.mail.content', [
            'name' => $this->incident->name,
        ]);

        return (new MailMessage())
                    ->subject(trans('notifications.incident.new.mail.subject'))
                    ->markdown('notifications.incident.new', [
                        'incident'               => $this->incident,
                        'content'                => $content,
                        'actionText'             => trans('notifications.incident.new.mail.action'),
                        'actionUrl'              => cachet_route('incident', [$this->incident]),
                        'unsubscribeText'        => trans('cachet.subscriber.unsubscribe'),
                        'unsubscribeUrl'         => cachet_route('subscribe.unsubscribe', $notifiable->verify_code),
                        'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'),
                        'manageSubscriptionUrl'  => cachet_route('subscribe.manage', $notifiable->verify_code),
                    ]);
    }
6128
public function getUnseenNotifications(NotifiableInterface $notifiable, $order = 'DESC', $limit = null,
                                           $offset = null)
    {
        return $this->notifiableNotificationRepository->findAllByNotifiable(
            $this->generateIdentifier($notifiable),
            ClassUtils::getRealClass(get_class($notifiable)),
            false,
            $order,
            $limit,
            $offset
        );
    }
451834
public function toMail($notifiable)
    {
        $password = $this->password;

        $message = new MailMessage();

        $message->viewData = [
            'email' => $email = $notifiable->getRecipientEmail(),
            'fullname' => $notifiable->getRecipientName(),
        ];

        $message->title(\trans('orchestra/foundation::email.register.title'))
                ->line(\trans('orchestra/foundation::email.register.message.intro'))
                ->line(\trans('orchestra/foundation::email.register.message.email', \compact('email')));

        if (! \is_null($this->password)) {
            $message->line(\trans('orchestra/foundation::email.register.message.password', \compact('password')));
        }

        return $message;
    }
959966
public function getPathByPageIdentifier( $pageIdentifier )
    {
        if ( !isset( $this->pageIdentifierMap[strtolower( $pageIdentifier )] ) )
        {
            throw new \RuntimeException( "Unknown page identifier '{$pageIdentifier}'." );
        }

        return $this->pageIdentifierMap[strtolower( $pageIdentifier )];
    }
207907
public function toMail($notifiable)
    {
        return (new MailMessage)
            ->subject(config('coaster::site.name') . ': New Account Details')
            ->from(config('coaster::site.email'))
            ->line('You have been created a new account on '.url()->to('/').' please see details below:')
            ->line('Username: ' . $this->_user->email)
            ->line('Password: ' . $this->_password)
            ->action('Go to Login', url(route($this->_routeName)));
    }
931317
public function createNotificationAndNotify(NotifiableInterface $notifiable)
    {
        $userIds = $this->getUsersToNotifyForNotifiable($notifiable);

        $notification = null;
        if (count($userIds) > 0) {
            $resourceId = null;
            if (null !== $notifiable->getResource()) {
                $resourceId = $notifiable->getResource()->getId();
            }

            $notification = $this->createNotification(
                $notifiable->getActionKey(),
                $notifiable->getIconKey(),
                $resourceId,
                $notifiable->getNotificationDetails(),
                $notifiable->getDoer()
            );
            $this->notifyUsers($notification, $userIds);
        }

        return $notification;
    }
274600
public function toDatabase($notifiable)
    {
        $labelFed = [
            'status' => $status = is_null($this->status) ? $this->order->status : $this->status,
            'source_id' => $this->order->id,
        ];

        return [
            'label' => Label::make('push.orders')->with($labelFed)->print(),
            'source_path' => $this->sourcePath($notifiable),
            'source_id' => $this->order->id,
            'status' => $status,
        ];
    }
335878
public function getMailParameters(NotificationEntity $notification, UserInfo $recipient)
    {
        $notificationData = $notification->getNotificationData();
        $locale = $this->app->make(LocaleRepository::class)->find($notificationData['localeID']);
        if ($locale === null) {
            throw new Exception(t('Unable to find the locale with ID %s', $notificationData['localeID']));
        }
        $requestedBy = $locale->getRequestedBy();

        return [
            'requestedBy' => $requestedBy,
            'localeName' => $locale->getDisplayName(),
            'teamsUrl' => $this->getBlockPageURL('CommunityTranslation Team List'),
            'notes' => $notificationData['notes'] ? $this->app->make('helper/text')->makenice($notificationData['notes']) : '',
        ] + $this->getCommonMailParameters($notification, $recipient);
    }
884397
public function getMailParameters(NotificationEntity $notification, UserInfo $recipient)
    {
        $notificationData = $notification->getNotificationData();
        $uir = $this->app->make(UserInfoRepository::class);
        $requestedBy = $notificationData['requestedBy'] ? $uir->getByID($notificationData['requestedBy']) : null;
        $deniedBy = $notificationData['by'] ? $uir->getByID($notificationData['by']) : null;

        return [
            'localeName' => Language::getName($notificationData['localeID']),
            'requestedBy' => $requestedBy,
            'deniedBy' => $deniedBy,
            'teamsUrl' => $this->getBlockPageURL('CommunityTranslation Team List'),
        ] + $this->getCommonMailParameters($notification, $recipient);
    }
755550
protected function formatNotifiables($notifiables)
    {
        // Notifiables can be an anonymous function that returns an array
        if (is_callable($notifiables)) {
            $notifiables = $notifiables();
        }

        // Always make sure we have an array
        if (! is_array($notifiables)) {
            return [$notifiables];
        }

        return $notifiables;
    }
1219023
public function findStandardIdentityByIdentifier(string $identifier): Entity\StandardIdentity
    {
        $identity = new Entity\StandardIdentity;
        $identity->setIdentifier($identifier);

        $this->repository->load($identity);

        if ($identity->getId() === null) {
            $this->logger->notice('identity not found', [
                'input' => [
                    'identifier' => $identifier,
                ],
            ]);

            throw new IdentityNotFound;
        }

        return $identity;
    }
1315136
public static function getIdentifier(ClassMetadata $targetEntity)
    {
        if (!isset(self::$cacheIdentifiers[$targetEntity->getName()])) {
            $identifier = $targetEntity->getIdentifierFieldNames();
            self::$cacheIdentifiers[$targetEntity->getName()] = 0 < \count($identifier)
                ? $identifier[0]
                : 'id';
        }

        return self::$cacheIdentifiers[$targetEntity->getName()];
    }
740716
protected function getRecipientIDs(NotificationEntity $notification)
    {
        $result = [];
        $notificationData = $notification->getNotificationData();
        $locale = $this->app->make(LocaleRepository::class)->findApproved($notificationData['localeID']);
        if ($locale === null) {
            throw new Exception(t('Unable to find the locale with ID %s', $notificationData['localeID']));
        }
        $group = $this->getGroupsHelper()->getAdministrators($locale);
        $result = array_merge($result, $group->getGroupMemberIDs());
        if (empty($result)) {
            $group = $this->getGroupsHelper()->getGlobalAdministrators();
            $result = $group->getGroupMemberIDs();
        }

        return $result;
    }