You are here

public function FollowContentActivityContext::getRecipients in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  2. 8 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  3. 8.2 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  4. 8.3 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  5. 8.4 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  6. 8.6 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  7. 8.7 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  8. 8.8 modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  9. 10.3.x modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  10. 10.0.x modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  11. 10.1.x modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()
  12. 10.2.x modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php \Drupal\social_follow_content\Plugin\ActivityContext\FollowContentActivityContext::getRecipients()

Returns a batched list of recipients for this context.

Format array( array ( id = uid or gip type = "user / group" ) )

Overrides ActivityContextBase::getRecipients

File

modules/social_features/social_follow_content/src/Plugin/ActivityContext/FollowContentActivityContext.php, line 22

Class

FollowContentActivityContext
Provides a 'FollowContentActivityContext' activity context plugin.

Namespace

Drupal\social_follow_content\Plugin\ActivityContext

Code

public function getRecipients(array $data, $last_uid, $limit) {
  $recipients = [];

  // We only know the context if there is a related object.
  if (isset($data['related_object']) && !empty($data['related_object'])) {
    $related_entity = ActivityFactory::getActivityRelatedEntity($data);
    if ($related_entity['target_type'] == 'node') {
      $recipients += $this
        ->getRecipientsWhoFollowContent($related_entity, $data);
    }
  }
  return $recipients;
}