Get all recipients with unsent Notifications.

@return array
511963
public function getNotificationRecipientIds()
    {
        $qb = $this->getEntityManager()->createQueryBuilder()
            ->select('n.recipient_id')
            ->distinct()
            ->from("Azine\EmailBundle\Entity\Notification", 'n')
            ->andWhere('n.sent is null');
        $results = $qb->getQuery()->execute();

        $ids = array();
        foreach ($results as $next) {
            $ids[] = $next['recipient_id'];
        }

        return $ids;
    }
1281899
protected function attachmentMessageToArray()
    {
        $message = [];
        $message['recipient'] = $this->recipient;
        $message['notification_type'] = $this->notificationType;
        $message['message']['attachment']['type'] = $this->attachmentType;
        $message['message']['attachment']['payload']['url'] = $this->attachmentUrl;

        return $message;
    }
35906
protected function getMessages() {
        if (!$this->_messages) {
            $this->_messages = new MessageList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_messages;
    }
1081382
public function unReadNotifications($user)
    {
        $notifications = MessageNotification::where([['user_id', '=', $user->getKey()], ['conversation_id', '=', $this->id], ['is_seen', '=', 0]])->get();

        return $notifications;
    }
1319707
public function getMessages()
    {
        $messages = array();
        foreach ($this->_fields as $fieldName => $values) {
            if (! $values['isValid']) {
                $invalidators = array();
                foreach ($values['validators'] as $validatorName => $validatorValue) {
                    if (! $validatorValue) {
                        $invalidators[] = $validatorName;
                    }
                }
                $messages[$fieldName] = $invalidators;
                unset($validator);
            }
            unset($fieldName);
            unset($values);
        }
        return $messages;
    }
587512
public function getMessage()
    {
        $result = [];

        $messages = (isset($this->indexReverse[self::MESSAGE])) ? $this->indexReverse[self::MESSAGE] : [];

        foreach ($messages as $index) {
            $result[] = $this->getChild($index);
        }

        return $result;
    }
783482
public function actionUnreadMessages()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        if (Yii::$app->user->isGuest) {
            return ['total' => 0];
        } else {
            $total = Message::getDb()->cache(function ($db) {
                return Message::find()->where(['user_id' => Yii::$app->user->id, 'status' => Message::STATUS_NEW])->count();
            }, 60);
            return ['total' => $total];
        }
    }
579864
protected function getEveryOption()
    {
        return [
            'notmailed'     => $this->_('Not emailed'),
            'tomail'        => $this->_('To email'),
            'toremind'      => $this->_('Needs reminder'),
            'hasnomail'     => $this->_('Missing email'),
            'notmailable'   => $this->_('Not allowed to email'),
        ];
    }
852759
public static function cancelAllNonPersistent()
    {
        foreach (static::getAllNotifications() as $id => $notification) {
            if (Notification::TYPE_PERSISTENT != $notification->type) {
                static::removeNotification($id);
            }
        }
    }
1250389
public function getNotification()
    {
        if (! $this->notification->isValid()) {
            throw new UnvalidNotificationException($this->notification);
        }

        $this->setDates();

        return $this->notification;
    }
1198318
public function updateNotProcessedNotifications()
    {

        $this->_debugData = array();

        $this->_debugData['processPosResponse begin'] = 'Begin to process cronjob for updating notifications from the queue';

        $this->_updateNotProcessedNotifications();

        $this->_debugData['processPosResponse end'] = 'Cronjob ends';

        return $this->_debugData;
    }
1068433
public function getAllSubscriptions()
    {
        $limit = RequestInterface::MAX_LIST_LIMIT;
        $offset = 0;
        $subscriptions = [[]];

        while (true) {
            $subscriptionBatch = $this->getSubscriptionsResponse($offset);
            $subscriptions[] = $subscriptionBatch;
            $offset += $limit;
            if (\count($subscriptionBatch) < $limit) {
                break;
            }
        }

        return \array_merge(...$subscriptions);
    }
1181360
protected function getSignalList(): array
    {
        if (null !== self::$list) {
            return self::$list;
        }

        $signals = [
            SIGHUP,
            SIGINT,
            SIGQUIT,
            SIGILL,
            SIGABRT,
            SIGTRAP,
            SIGBUS,
            SIGTERM,
            SIGSEGV,
            SIGFPE,
            SIGALRM,
            SIGVTALRM,
            SIGPROF,
            SIGIO,
            SIGCONT,
            SIGURG,
            SIGPIPE,
            SIGXCPU,
            SIGXFSZ,
            SIGTTIN,
            SIGTTOU,
            SIGUSR1,
            SIGUSR2,
        ];

        if (defined('SIGIOT')) {
            $signals[] = SIGIOT;
        }

        if (defined('SIGSTKFLT')) {
            $signals[] = SIGSTKFLT;
        }

        if (defined('SIGCLD')) {
            $signals[] = SIGCLD;
        }

        if (defined('SIGCHLD')) {
            $signals[] = SIGCHLD;
        }

        return self::$list = $signals;
    }
910142
public function receive()
    {
        if (($shmId = @shmop_open($this->pid, 'a', 0, 0)) > 0) {
            $serializedMessages = shmop_read($shmId, 0, shmop_size($shmId));
            shmop_delete($shmId);
            shmop_close($shmId);

            return unserialize($serializedMessages);
        }

        return array();
    }
1107191
public function broadcastWith()
    {
        return array_merge($this->data, array(
            'id'   => $this->notification->id,
            'type' => get_class($this->notification),
        ));
    }
584638
public static function getAllNotificationsToDisplay()
    {
        $notifications = static::getAllNotifications();

        uasort($notifications, function ($n1, $n2) {
            /** @var Notification $n1 */ /** @var Notification $n2 */
            if ($n1->getPriority() == $n2->getPriority()) {
                return 0;
            }

            return $n1->getPriority() > $n2->getPriority() ? -1 : 1;
        });

        return $notifications;
    }
284150
public function getMessages()
    {
        $messages = parent::getMessages();

        foreach ($this->children as $child) {
            $messages = array_merge($messages, $child->getMessages());
        }

        return $messages;
    }