EventEnrollment.php in Open Social 8.8
Same filename in this branch
Same filename and directory in other branches
- 8.9 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 8 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 8.2 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 8.3 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 8.4 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 8.5 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 8.6 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 8.7 modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 10.3.x modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 10.0.x modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 10.1.x modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
- 10.2.x modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.php
Namespace
Drupal\social_demo\Plugin\DemoContentFile
modules/custom/social_demo/src/Plugin/DemoContent/EventEnrollment.phpView source
<?php
namespace Drupal\social_demo\Plugin\DemoContent;
use Drupal\social_demo\DemoEntity;
/**
* EventEnrollment Plugin for demo content.
*
* @DemoContent(
* id = "event_enrollment",
* label = @Translation("Event enrollment"),
* source = "content/entity/event-enrollment.yml",
* entity_type = "event_enrollment"
* )
*/
class EventEnrollment extends DemoEntity {
/**
* {@inheritdoc}
*/
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,
];
}
}
Classes
Name | Description |
---|---|
EventEnrollment | EventEnrollment Plugin for demo content. |