You are here

protected function Event::prepareEventManagers in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  2. 8.2 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  3. 8.3 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  4. 8.4 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  5. 8.5 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  6. 8.6 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  7. 8.7 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  8. 8.8 modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  9. 10.3.x modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  10. 10.0.x modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  11. 10.1.x modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()
  12. 10.2.x modules/custom/social_demo/src/Plugin/DemoContent/Event.php \Drupal\social_demo\Plugin\DemoContent\Event::prepareEventManagers()

Returns event managers.

Parameters

array $managers: An array of uuids.

Return value

array|null Returns an array or null.

1 call to Event::prepareEventManagers()
Event::getEntry in modules/custom/social_demo/src/Plugin/DemoContent/Event.php
Makes an array with data of an entity.

File

modules/custom/social_demo/src/Plugin/DemoContent/Event.php, line 216

Class

Event
Event Plugin for demo content.

Namespace

Drupal\social_demo\Plugin\DemoContent

Code

protected function prepareEventManagers(array $managers) {
  $values = NULL;
  foreach ($managers as $uuid) {

    // Load the user(s) by the given uuid(s).
    $load = $this->userStorage
      ->loadByProperties([
      'uuid' => $uuid,
    ]);
    $account = current($load);
    if ($account instanceof User) {
      $properties = [
        'target_id' => $account
          ->id(),
      ];
      $values[] = $properties;
    }
  }
  return $values;
}