确定通知实体是否应通过签入通知设置来接收通知。
@param Notification $notification
@return bool
186106
public function shouldReceiveNotification(Notification $notification)
    {
        $alias = get_class($notification);
        if (isset($this->notificationSettings)) {
            $settings = $this->notificationSettings;
            if (array_key_exists($alias, $settings)) {
                if ($settings[$alias] instanceof \Closure) {
                    return call_user_func($settings[$alias], $notification);
                }
                return (bool)$settings[$alias];
            }
        }
        return true;
    }
22314
public function withNotification($notification): self
    {
        $new = clone $this;
        $new->notification = $notification instanceof Notification ? $notification : Notification::fromArray($notification);

        return $new;
    }
1133551
public function send($notifiable, Notification $notification)
    {
        return $notifiable->routeNotificationFor('database', $notification)->create(
            $this->buildPayload($notifiable, $notification)
        );
    }
317704
public function send($notifiable, Notification $notification)
    {
        $message = $notification->toMail($notifiable);

        if (! $notifiable->routeNotificationFor('mail', $notification) &&
            ! $message instanceof Mailable) {
            return;
        }

        if ($message instanceof Mailable) {
            return $message->send($this->mailer);
        }

        $this->mailer->send(
            $this->buildView($message),
            array_merge($message->data(), $this->additionalMessageData($notification)),
            $this->messageBuilder($notifiable, $notification, $message)
        );
    }
980047
public function notify(array $devices, array $notification)
    {
        $headers = $this->getNotificationHeaders();
        $body = $this->getNotificationBody($devices, $notification);

        return $this->sendRequest($headers, $body);
    }
524619
public function viewedNotifications($notifications)
    {
        $notifications = (array) $notifications;

        $ids = clone $this->newNotificationIds;

        foreach ($notifications as $notification) {
            $ids->offsetUnset($notification->id);
        }

        $this->set('newNotificationIds', $ids);

        $this->save();
    }
69611
public function send($notifiables, $notification)
    {
        if (! $notifiables instanceof Collection && ! is_array($notifiables)) {
            $notifiables = [$notifiables];
        }

        if ($notification instanceof ShouldQueue) {
            return $this->queueNotification($notifiables, $notification);
        }

        return $this->sendNow($notifiables, $notification);
    }
935054
public function addNotifications(array $notifications)
    {
        foreach ($notifications as $notification) {
            if (in_array($notification, $this->notifications, true)) {
                continue;
            }

            $this->addNotification($notification);
        }
    }
174142
public function send($notifiable, Notification $notification)
    {
        $interest = $notifiable->routeNotificationFor('PusherPushNotifications')
            ?: $this->interestName($notifiable);

        $response = $this->pusher->notify(
            $interest,
            $notification->toPushNotification($notifiable)->toArray(),
            true
        );

        if (! in_array($response['status'], [200, 202])) {
            $this->events->fire(
                new NotificationFailed($notifiable, $notification, 'pusher-push-notifications', $response)
            );
        }
    }
937395
public function handle(NotificationInterface $notification, $level)
    {
        if (!headers_sent())
        {
            if ($notification instanceof AttributeAwareInterface)
            {
                $options = $notification->attributes();
            }
            else
            {
                $options = [];
            }

            if ($notification instanceof TitleAwareInterface)
            {
                $options['header'] = $notification->title();
            }

            header(
                'X-' . $this->identifier . '-Notification-' . self::$messageindex++ . ':' .
                json_encode(
                    [
                        'message' => $notification->message(),
                        'type'    => isset($this->levelMapping[$level]) ? $this->levelMapping[$level] : self::STANDARD,
                        'options' => $options
                    ]
                )
            );

            return true;
        }

        return true;
    }
785795
protected function setNotificationsAsSent(array $notifications)
    {
        foreach ($notifications as $notification) {
            $notification->setSent(new \DateTime());
            $this->managerRegistry->getManager()->persist($notification);
        }
        $this->managerRegistry->getManager()->flush();
    }
131453
public function setNotification($notification = '')
    {
        if ('' == $notification) {
            $notification = 'General Notification';
        }

        if (!is_string($notification)) {
            throw new BuildException(
                '"notification" attribute is invalid.' .
                ' Expect to be a string, actual is ' . gettype($notification)
            );
        }

        $this->notification = $notification;
    }
1100729
public function withNotification($notification)
    {
        $notification = $notification instanceof Notification
            ? $notification
            : Notification::fromArray((array) $notification);

        $message = clone $this;
        $message->notification = $notification;

        return $message;
    }
491338
public boolean deleteNotification(Notification notification) {
        boolean result = notification.canDelete();

        if (result) {
            broker.callRPC("RGCWXQ ALRPP", notification.getAlertId());
        }

        return result;
    }
333285
public function send($notifiable, Notification $notification)
    {
        $this->events->fire(new BroadcastNotificationCreated(
            $notifiable, $notification, $this->getData($notifiable, $notification)
        ));
    }
471259
public function send(Notification $notification)
    {
        $original = clone $notification;

        foreach ($notification->via() as $channel => $notifiables) {
            $notifiables = $this->formatNotifiables($notifiables);

            foreach ($notifiables as $notifiable) {
                $notificationId = Uuid::uuid4()->toString();
                $notification = clone $original;

                if (! $notification->id) {
                    $notification->id = $notificationId;
                }

                if (! $this->shouldSendNotification($notifiable, $notification, $channel)) {
                    continue;
                }

                $response = $this->channel($channel)->send($notifiable, $notification);

                $event = new SendEvent([
                    'notification' => $notification,
                    'notifiable' => $notifiable,
                    'channel' => $channel,
                    'response' => $response,
                ]);

                $this->trigger(self::EVENT_AFTER_SEND, $event);
            }
        }
    }
194020
protected function buildNotifyCommand(Notification $notification)
    {
        if ($notification->isPassed()) {
            $title = self::TITLE_PASSED;
            $icon = self::$ICON_PASSED;
            $sound = self::SOUND_PASSED;
        } elseif ($notification->isFailed()) {
            $title = self::TITLE_FAILED;
            $icon = self::$ICON_FAILED;
            $sound = self::SOUND_FAILED;
        } elseif ($notification->isStopped()) {
            $title = self::TITLE_STOPPED;
            $icon = self::$ICON_STOPPED;
            $sound = self::SOUND_STOPPED;
        }

        if ($this->os->isWin()) {
            return sprintf(
                'growlnotify /t:%s /p:-2 /i:%s /a:Stagehand_TestRunner /r:%s,%s,%s /n:%s /silent:true %s',
                escapeshellarg($title),
                escapeshellarg($icon),
                escapeshellarg(self::TITLE_PASSED),
                escapeshellarg(self::TITLE_FAILED),
                escapeshellarg(self::TITLE_STOPPED),
                escapeshellarg($title),
                escapeshellarg($notification->getMessage())
            );
        } elseif ($this->os->isAfterMarvericks() && !$this->hasGrowl('osascript')) {
            return sprintf(
                'osascript -e "display notification \"%s\" subtitle \"%s\" sound name \"%s\""',
                escapeshellarg($notification->getMessage()),
                escapeshellcmd($title),
                escapeshellcmd($sound)
            );
        } elseif ($this->os->isDarwin()) {
            return sprintf(
                'growlnotify --name %s --priority -2 --image %s --title %s --message %s',
                escapeshellarg($title),
                escapeshellarg($icon),
                escapeshellarg($title),
                escapeshellarg($notification->getMessage())
            );
        } elseif ($this->os->isLinux()) {
            return sprintf(
                'notify-send --urgency=low --icon=%s %s %s',
                escapeshellarg($icon),
                escapeshellarg($title),
                escapeshellarg(str_replace('\\', '\\\\', $notification->getMessage()))
            );
        }
    }