Elgg\Notifications\NotificationsService::getNotificationSubject PHP Метод

getNotificationSubject() приватный Метод

Plugins can define a subtype specific subject simply by providing a translation for the string "notification:subject::: '%s published a blog called %s'
private getNotificationSubject ( Elgg\Notifications\NotificationEvent $event, ElggUse\ElggUser $recipient ) : string
$event Elgg\Notifications\NotificationEvent Notification event
$recipient ElggUse\ElggUser Notification recipient
Результат string Notification subject in the recipient's language
    private function getNotificationSubject(NotificationEvent $event, ElggUser $recipient)
    {
        $actor = $event->getActor();
        $object = $event->getObject();
        /* @var \ElggObject $object */
        $language = $recipient->language;
        // Check custom notification subject for the action/type/subtype combination
        $subject_key = "notification:{$event->getDescription()}:subject";
        if ($this->translator->languageKeyExists($subject_key, $language)) {
            if ($object instanceof \ElggEntity) {
                $display_name = $object->getDisplayName();
            } else {
                $display_name = '';
            }
            return $this->translator->translate($subject_key, array($actor->name, $display_name), $language);
        }
        // Fall back to default subject
        return $this->translator->translate('notification:subject', array($actor->name), $language);
    }