social_lms_integrator-1.0.0-beta4/modules/social_lms_integrator_export/src/Plugin/SocialLMSIntegratorExportPlugin/IterationEnrollmentAddressLocality.php
modules/social_lms_integrator_export/src/Plugin/SocialLMSIntegratorExportPlugin/IterationEnrollmentAddressLocality.php
<?php
namespace Drupal\social_lms_integrator_export\Plugin\SocialLMSIntegratorExportPlugin;
use Drupal\social_lms_integrator_export\Plugin\SocialLMSIntegratorExportPluginBase;
use Drupal\social_lms_integrator_enrollment\IterationEnrollmentInterface;
/**
* Provides a 'IterationEnrollmentAddressLocality' Social LMS Integrator export row.
*
* @SocialLMSIntegratorExportPlugin(
* id = "iteration_enrollment_address_locality",
* label = @Translation("Address locality"),
* weight = -480,
* )
*/
class IterationEnrollmentAddressLocality extends SocialLMSIntegratorExportPluginBase {
/**
* {@inheritdoc}
*/
public function getHeader() {
return $this->t('Address locality');
}
/**
* {@inheritdoc}
*/
public function getValue(IterationEnrollmentInterface $entity) {
// Get the user from the Iteration enrollment
$user = $this->getAccount($entity);
return $this->profileGetAddressFieldValue('field_profile_address', 'locality', $this->getProfile($user));
}
}