Adds a new notification for the actor.

@param ComNotificationsDomainEntityNotification $notification Notification
510294
public function addNotification($notification)
    {
        $this->_mixer->getRepository()
        ->registerCallback('before.update', array($this, 'resetStats'), array($this->_mixer));

        $this->_mixer->getRepository()
        ->registerCallback('before.update', array($this, 'removeOldNotifications'), array($this->_mixer));

        $ids = clone $this->notificationIds;
        $ids[] = $notification->id;
        $this->set('notificationIds', $ids);

        $ids = clone $this->newNotificationIds;
        $ids[] = $notification->id;
        $this->set('newNotificationIds', $ids);
    }
726636
public function setNotification($notification)
    {
        if ($notification !== null && !is_callable($notification))
            throw new \InvalidArgumentException('Notification handler must be a callable.');

        $this->notification = $notification;
        return $this;
    }
953740
public function send($notifiable, Notification $notification)
    {
        if (! $to = $notifiable->routeNotificationFor('nexmo')) {
            return;
        }

        $message = $notification->toNexmo($notifiable);

        if (is_string($message)) {
            $message = new NexmoMessage($message);
        }

        $this->nexmo->message()->send([
            'from' => $message->from ?: $this->from,
            'to' => $to,
            'text' => trim($message->content),
        ]);
    }
785795
protected function setNotificationsAsSent(array $notifications)
    {
        foreach ($notifications as $notification) {
            $notification->setSent(new \DateTime());
            $this->managerRegistry->getManager()->persist($notification);
        }
        $this->managerRegistry->getManager()->flush();
    }
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)
            );
        }
    }
256599
@SuppressWarnings("unchecked")
     public static void addNotification(Event e, String interaction) {
        NotificationManager.notifications.add(new InteractionNotification(getNotificationID(),
                                        NotificationManager.sim.getSchedule().getSteps(), e.getLauncher(), 
                                        interaction, (List<Object>) e.getAffected()));
        logger.fine("New notification added to notifications list. There is currently: " +
                    notifications.size()+" notifications\n Notification added: "
                    +NotificationManager.notifications.get(NotificationManager.notifications.size()-1));
    }
966935
public function send($notifiables, $notification)
    {
        return (new NotificationSender(
            $this, $this->app->make(Bus::class), $this->app->make(Dispatcher::class), $this->locale)
        )->send($notifiables, $notification);
    }
1040108
protected function buildDomainObject(Notification $spiNotification): APINotification
    {
        return new APINotification([
            'id' => $spiNotification->id,
            'ownerId' => $spiNotification->ownerId,
            'isPending' => $spiNotification->isPending,
            'type' => $spiNotification->type,
            'created' => new DateTime("@{$spiNotification->created}"),
            'data' => $spiNotification->data,
        ]);
    }
519510
public static void addNotification(Notification n) {
        NotificationManager.notifications.add(n);
        logger.fine("New notification added to notifications list. There is currently: " +
                    notifications.size()+" notifications\n Notification added: "
                    +NotificationManager.notifications.get(NotificationManager.notifications.size()-1));
    }
26496
private function prepareApnsHeaders(Notification $notification)
    {
        if (!empty($notification->getId())) {
            $this->headers[self::HEADER_APNS_ID] =  $notification->getId();
        }

        if ($notification->getExpirationAt() instanceof \DateTime) {
            $this->headers[self::HEADER_APNS_EXPIRATION] = $notification->getExpirationAt()->getTimestamp();
        }

        if (is_int($notification->getPriority())) {
            $this->headers[self::HEADER_APNS_PRIORITY] =  $notification->getPriority();
        }

        if (!empty($notification->getCollapseId())) {
            $this->headers[self::HEADER_APNS_COLLAPSE_ID ] = $notification->getCollapseId();
        }
    }
427118
protected function addNotification($message)
    {
        $event = new NotificationEvent();
        $event->setMessage($message);
        
        $this
            ->eventDispatcher
            ->dispatch(NotificationEvent::NAME, $event)
        ;
    }
42333
public function send($notifiable, Notification $notification)
    {
        if (!$to = $notifiable->routeNotificationFor('SMS')) {
            return;
        }

        $message = $notification->toSMS($notifiable);
        if (is_string($message)) {
            $message = new SMSMessage($message);
        }

        $this->SMSManager
            ->channel($message->channel)
            ->send($to, $message->content);
    }
382932
public function send($notifiable, Notification $notification)
    {
        $message = $notification->toSlack();

        $this->http->post($notifiable, $this->buildJsonPayload($message));
    }
373340
public function send(Notification $notification)
    {
        $message = $this->composeMessage($notification);
        $message->send($this->mailer);
    }
459715
public synchronized ApptentiveNotificationCenter addObserver(String notification, ApptentiveNotificationObserver observer) {
		addObserver(notification, observer, false);
		return this;
	}
32912
private void notificationCallback(Notification notification) {
    if (notification instanceof MetricContextCleanupNotification) {
      removedMetricContext(((MetricContextCleanupNotification) notification).getMetricContext());
    }
    if (notification instanceof NewMetricContextNotification) {
      newMetricContext(((NewMetricContextNotification) notification).getMetricContext());
    }
  }
615761
public function addNotifiableNotification(NotifiableNotification $notifiableNotification)
    {
        if (!$this->notifiableNotifications->contains($notifiableNotification)) {
            $this->notifiableNotifications[] = $notifiableNotification;
            $notifiableNotification->setNotification($this);
        }

        return $this;
    }