Elgg\Notifications\NotificationsService::getDeprecatedNotificationBody PHP Method

getDeprecatedNotificationBody() protected method

Get the notification body using a pre-Elgg 1.9 plugin hook
protected getDeprecatedNotificationBody ( Notification $notification, Elgg\Notifications\NotificationEvent $event, string $method ) : Notification
$notification Notification Notification
$event Elgg\Notifications\NotificationEvent Event
$method string Method
return Notification
    protected function getDeprecatedNotificationBody(Notification $notification, NotificationEvent $event, $method)
    {
        $entity = $event->getObject();
        if (!$entity) {
            return $notification;
        }
        $params = array('entity' => $entity, 'to_entity' => $notification->getRecipient(), 'method' => $method);
        $subject = $this->getDeprecatedNotificationSubject($entity->getType(), $entity->getSubtype());
        $string = $subject . ": " . $entity->getURL();
        $body = $this->hooks->trigger('notify:entity:message', $entity->getType(), $params, $string);
        if ($subject) {
            $notification->subject = $subject;
            $notification->body = $body;
        }
        return $notification;
    }