You are here

UserStatus.php in Open Social 8.4

File

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

namespace Drupal\social_user_export\Plugin\UserExportPlugin;

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

/**
 * Provides a 'UserStatus' user export row.
 *
 * @UserExportPlugin(
 *  id = "user_status",
 *  label = @Translation("Status"),
 *  weight = -400,
 * )
 */
class UserStatus extends UserExportPluginBase {

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

  /**
   * {@inheritdoc}
   */
  public function getValue(UserInterface $entity) {
    return $entity
      ->isActive() ? $this
      ->t('Active') : $this
      ->t('Blocked');
  }

}

Classes

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