You are here

UserNickName.php in Open Social 8.5

File

modules/social_features/social_profile/modules/social_profile_fields/src/Plugin/UserExportPlugin/UserNickName.php
View source
<?php

namespace Drupal\social_profile_fields\Plugin\UserExportPlugin;

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

/**
 * Provides a 'UserNickName' user export row.
 *
 * @UserExportPlugin(
 *  id = "user_nickname",
 *  label = @Translation("Nickname"),
 *  weight = -449,
 * )
 */
class UserNickName extends UserExportPluginBase {

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

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

}

Classes

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