You are here

private static function UserMailQueueProcessor::validateQueueItem in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::validateQueueItem()
  2. 10.3.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::validateQueueItem()
  3. 10.0.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::validateQueueItem()
  4. 10.1.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::validateQueueItem()
  5. 10.2.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::validateQueueItem()

Validate the queue item data.

Before processing the queue item data we want to check if all the necessary components are available.

Parameters

array $data: The content of the queue item.

Return value

bool True if the item contains all the necessary data.

1 call to UserMailQueueProcessor::validateQueueItem()
UserMailQueueProcessor::processItem in modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php
Works on a single queue item.

File

modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php, line 221

Class

UserMailQueueProcessor
Queue worker to process email to users.

Namespace

Drupal\social_user\Plugin\QueueWorker

Code

private static function validateQueueItem(array $data) {

  // The queue data must contain the 'mail' key and it should either
  // contain 'users' or 'user_mail_addresses'.
  return isset($data['mail']) && (isset($data['users']) || isset($data['user_mail_addresses']));
}