EnrolmentUserLastName.php in Open Social 8.8
Same filename and directory in other branches
- 8.9 modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
- 8.5 modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
- 8.6 modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
- 8.7 modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
- 10.3.x modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
- 10.0.x modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
- 10.1.x modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
- 10.2.x modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.php
File
modules/social_features/social_event/modules/social_event_an_enroll_enrolments_export/src/Plugin/UserExportPlugin/EnrolmentUserLastName.phpView source
<?php
namespace Drupal\social_event_an_enroll_enrolments_export\Plugin\UserExportPlugin;
use Drupal\social_user_export\Plugin\UserExportPlugin\UserLastName;
use Drupal\user\UserInterface;
/**
* Provides a 'EnrolmentUserLastName' user export row.
*
* @UserExportPlugin(
* id = "enrolment_user_last_name",
* label = @Translation("Last name"),
* weight = -470,
* )
*/
class EnrolmentUserLastName extends UserLastName {
/**
* {@inheritdoc}
*/
public function getValue(UserInterface $entity) {
if ($entity
->isAnonymous()) {
$entity =& $this->configuration['entity'];
if (!$entity->field_last_name
->isEmpty()) {
return $entity->field_last_name->value;
}
return '';
}
return parent::getValue($entity);
}
}
Classes
Name | Description |
---|---|
EnrolmentUserLastName | Provides a 'EnrolmentUserLastName' user export row. |