You are here

UserPhoneNumber.php in Open Social 10.0.x

File

modules/social_features/social_user_export/src/Plugin/UserExportPlugin/UserPhoneNumber.php
View source
<?php

namespace Drupal\social_user_export\Plugin\UserExportPlugin;

use Drupal\social_user_export\Plugin\UserExportPluginBase;
use Drupal\user\UserInterface;

/**
 * Provides a 'UserPhoneNumber' user export row.
 *
 * @UserExportPlugin(
 *  id = "user_phone_number",
 *  label = @Translation("Phone number"),
 *  weight = -330,
 * )
 */
class UserPhoneNumber extends UserExportPluginBase {

  /**
   * {@inheritdoc}
   */
  public function getHeader() {
    return $this
      ->t('Phone number');
  }

  /**
   * {@inheritdoc}
   */
  public function getValue(UserInterface $entity) {
    return $this
      ->profileGetFieldValue('field_profile_phone_number', $this
      ->getProfile($entity));
  }

}

Classes

Namesort descending Description
UserPhoneNumber Provides a 'UserPhoneNumber' user export row.