You are here

public function DigestBase::getRecipients in Message Digest 8

Get a unique list of recipient user IDs for this digest.

Return value

int[] An array of unique recipients for this digest.

Overrides DigestInterface::getRecipients

File

src/Plugin/Notifier/DigestBase.php, line 157

Class

DigestBase
Message Digest notifier.

Namespace

Drupal\message_digest\Plugin\Notifier

Code

public function getRecipients() {
  $query = $this->connection
    ->select('message_digest', 'md');
  $query
    ->fields('md', [
    'receiver',
  ]);
  $query
    ->condition('timestamp', $this
    ->getEndTime(), '<=');
  $query
    ->condition('sent', 0);
  $query
    ->condition('notifier', $this
    ->getPluginId());
  $query
    ->distinct();
  return $query
    ->execute()
    ->fetchCol();
}