You are here

UserDisplayName.php in Open Social 8.7

File

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

namespace Drupal\social_user_export\Plugin\UserExportPlugin;

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

/**
 * Provides a 'UserDisplayName' user export row.
 *
 * @UserExportPlugin(
 *  id = "display_name",
 *  label = @Translation("Display name"),
 *  weight = -450,
 * )
 */
class UserDisplayName extends UserExportPluginBase {

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

  /**
   * {@inheritdoc}
   */
  public function getValue(UserInterface $entity) {
    return $entity
      ->getDisplayName();
  }

}

Classes

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