You are here

public function EventEnrollment::getEntry in Open Social 10.2.x

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

Makes an array with data of an entity.

Parameters

array $item: Array with items.

Return value

array Returns an array.

Overrides DemoEntity::getEntry

File

modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php, line 22

Class

EventEnrollment
EventEnrollment Plugin for demo content.

Namespace

Drupal\social_demo\Plugin\DemoContent

Code

public function getEntry(array $item) {
  $uid = $this
    ->loadByUuid('user', $item['uid'])
    ->id();
  $entry = parent::getEntry($item);
  return $entry + [
    'langcode' => $item['langcode'],
    'name' => substr($item['title'], 0, 50),
    'user_id' => $uid,
    'created' => \Drupal::time()
      ->getRequestTime(),
    'field_event' => $this
      ->loadByUuid('node', $item['field_event'])
      ->id(),
    'field_enrollment_status' => $item['field_enrollment_status'],
    'field_account' => $uid,
  ];
}