public function ContentReportActivityContext::getRecipients in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
- 8.5 modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
- 8.6 modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
- 8.7 modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
- 8.8 modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
- 10.3.x modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
- 10.0.x modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
- 10.2.x modules/social_features/social_content_report/src/Plugin/ActivityContext/ContentReportActivityContext.php \Drupal\social_content_report\Plugin\ActivityContext\ContentReportActivityContext::getRecipients()
Returns a batched list of recipients for this context.
Parameters
array $data: The data.
int $last_id: The last ID.
int $limit: The limit.
Return value
array An associative array of recipients, containing the following key-value pairs:
- target_type: The entity type ID.
- target_id: The entity ID.
Overrides ActivityContextBase::getRecipients
File
- modules/
social_features/ social_content_report/ src/ Plugin/ ActivityContext/ ContentReportActivityContext.php, line 20
Class
- ContentReportActivityContext
- Provides a 'ContentReportActivityContext' activity context.
Namespace
Drupal\social_content_report\Plugin\ActivityContextCode
public function getRecipients(array $data, $last_uid, $limit) {
$recipients = [];
$ids = $this->entityTypeManager
->getStorage('user')
->getQuery()
->condition('status', 1)
->condition('roles', $this
->getRolesWithPermission(), 'IN')
->execute();
if (!empty($ids)) {
// Create a list of recipients in the expected format.
foreach ($ids as $uid) {
$recipients[] = [
'target_type' => 'user',
'target_id' => $uid,
];
}
}
return $recipients;
}