You are here

class User in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/user/src/Entity/User.php \Drupal\user\Entity\User
  2. 8 core/modules/user/src/Plugin/views/argument_default/User.php \Drupal\user\Plugin\views\argument_default\User
  3. 8 core/modules/user/src/Plugin/views/argument_validator/User.php \Drupal\user\Plugin\views\argument_validator\User
  4. 8 core/modules/user/src/Plugin/migrate/source/d6/User.php \Drupal\user\Plugin\migrate\source\d6\User
  5. 8 core/modules/user/src/Plugin/migrate/source/d7/User.php \Drupal\user\Plugin\migrate\source\d7\User
  6. 8 core/modules/user/src/Plugin/migrate/builder/d7/User.php \Drupal\user\Plugin\migrate\builder\d7\User
Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Plugin/migrate/builder/d7/User.php \Drupal\user\Plugin\migrate\builder\d7\User

Plugin annotation

@PluginID("d7_user");

Hierarchy

Expanded class hierarchy of User

27 string references to 'User'
BulkFormAccessTest::testUserEditAccess in core/modules/user/src/Tests/Views/BulkFormAccessTest.php
Tests if users that may not be edited, can not be edited in bulk.
CategoryAutocompleteTest::providerTestAutocompleteSuggestions in core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
Data provider for testAutocompleteSuggestions().
CategoryAutocompleteTest::setUp in core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
contact_entity_extra_field_info in core/modules/contact/contact.module
Implements hook_entity_extra_field_info().
ContextPluginTest::testContext in core/modules/system/src/Tests/Plugin/ContextPluginTest.php
Tests basic context definition and value getters and setters.

... See full list

File

core/modules/user/src/Plugin/migrate/builder/d7/User.php, line 20
Contains \Drupal\user\Plugin\migrate\builder\d7\User.

Namespace

Drupal\user\Plugin\migrate\builder\d7
View source
class User extends BuilderBase implements ContainerFactoryPluginInterface {

  /**
   * The module handler service.
   *
   * @var \Drupal\Core\Extension\ModuleHandlerInterface
   */
  protected $moduleHandler;

  /**
   * Constructs a d7_user builder plugin instance.
   *
   * @param array $configuration
   *   The plugin configuration.
   * @param string $plugin_id
   *   The plugin ID.
   * @param mixed $plugin_definition
   *   The plugin definition.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler service.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->moduleHandler = $module_handler;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('module_handler'));
  }

  /**
   * {@inheritdoc}
   */
  public function buildMigrations(array $template) {
    $migration = Migration::create($template);
    if ($this->moduleHandler
      ->moduleExists('field')) {
      $template['source']['entity_type'] = 'user';
      $source_plugin = $this
        ->getSourcePlugin('d7_field_instance', $template['source']);
      foreach ($source_plugin as $field) {
        $field_name = $field
          ->getSourceProperty('field_name');
        $migration
          ->setProcessOfProperty($field_name, $field_name);
      }
    }
    try {
      $profile_fields = $this
        ->getSourcePlugin('profile_field', $template['source']);

      // Ensure that Profile is enabled in the source DB.
      $profile_fields
        ->checkRequirements();
      foreach ($profile_fields as $field) {
        $field_name = $field
          ->getSourceProperty('name');
        $migration
          ->setProcessOfProperty($field_name, $field_name);
      }
    } catch (RequirementsException $e) {

      // Profile is not enabled in the source DB, so don't do anything.
    }
    return [
      $migration,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BuilderBase::getSourcePlugin protected function Returns a fully initialized instance of a source plugin.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
PluginBase::$configuration protected property Configuration information passed into the plugin. 2
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
StringTranslationTrait::$stringTranslation protected property The string translation service.
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
User::$moduleHandler protected property The module handler service.
User::buildMigrations public function Builds migration entities based on a template. Overrides MigrateBuilderInterface::buildMigrations
User::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
User::__construct public function Constructs a d7_user builder plugin instance. Overrides PluginBase::__construct