class Role
Same name in this branch
- 10 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role
- 10 core/modules/user/src/Plugin/views/access/Role.php \Drupal\user\Plugin\views\access\Role
- 10 core/modules/user/src/Plugin/migrate/source/d6/Role.php \Drupal\user\Plugin\migrate\source\d6\Role
Same name and namespace in other branches
- 9 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role
- 9 core/modules/user/src/Plugin/views/access/Role.php \Drupal\user\Plugin\views\access\Role
- 9 core/modules/user/src/Plugin/migrate/source/d6/Role.php \Drupal\user\Plugin\migrate\source\d6\Role
- 9 core/modules/user/src/Plugin/migrate/source/d7/Role.php \Drupal\user\Plugin\migrate\source\d7\Role
- 8.9.x core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role
- 8.9.x core/modules/user/src/Plugin/views/access/Role.php \Drupal\user\Plugin\views\access\Role
- 8.9.x core/modules/user/src/Plugin/migrate/source/d6/Role.php \Drupal\user\Plugin\migrate\source\d6\Role
- 8.9.x core/modules/user/src/Plugin/migrate/source/d7/Role.php \Drupal\user\Plugin\migrate\source\d7\Role
- 11.x core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role
- 11.x core/modules/user/src/Plugin/views/access/Role.php \Drupal\user\Plugin\views\access\Role
- 11.x core/modules/user/src/Plugin/migrate/source/d6/Role.php \Drupal\user\Plugin\migrate\source\d6\Role
- 11.x core/modules/user/src/Plugin/migrate/source/d7/Role.php \Drupal\user\Plugin\migrate\source\d7\Role
Drupal 7 role source from database.
For available configuration keys, refer to the parent classes.
Plugin annotation
@MigrateSource(
id = "d7_user_role",
source_module = "user"
)
Hierarchy
- class \Drupal\user\Plugin\migrate\source\d7\Role
Expanded class hierarchy of Role
See also
\Drupal\migrate\Plugin\migrate\source\SqlBase
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase
15 string references to 'Role'
- Block::query in core/
modules/ block/ src/ Plugin/ migrate/ source/ Block.php - ChangeUserRoleBase::buildConfigurationForm in core/
modules/ user/ src/ Plugin/ Action/ ChangeUserRoleBase.php - Form constructor.
- Role::buildOptionsForm in core/
modules/ user/ src/ Plugin/ views/ access/ Role.php - Provide a form to edit options for this plugin.
- Role::validateOptionsForm in core/
modules/ user/ src/ Plugin/ views/ access/ Role.php - Validate the options form.
- StandardTestTrait::testStandard in core/
profiles/ standard/ tests/ src/ Traits/ StandardTestTrait.php - Tests Standard installation profile or recipe.
File
-
core/
modules/ user/ src/ Plugin/ migrate/ source/ d7/ Role.php, line 21
Namespace
Drupal\user\Plugin\migrate\source\d7View source
class Role extends DrupalSqlBase {
/**
* {@inheritdoc}
*/
public function query() {
return $this->select('role', 'r')
->fields('r');
}
/**
* {@inheritdoc}
*/
public function fields() {
return [
'rid' => $this->t('Role ID.'),
'name' => $this->t('The name of the user role.'),
'weight' => $this->t('The weight of the role.'),
];
}
/**
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
$permissions = $this->select('role_permission', 'rp')
->fields('rp', [
'permission',
])
->condition('rid', $row->getSourceProperty('rid'))
->execute()
->fetchCol();
$row->setSourceProperty('permissions', $permissions);
return parent::prepareRow($row);
}
/**
* {@inheritdoc}
*/
public function getIds() {
$ids['rid']['type'] = 'integer';
return $ids;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | ||
DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | ||
DependencySerializationTrait::__wakeup | public | function | #[\ReturnTypeWillChange] | 2 | |
DependencyTrait::$dependencies | protected | property | The object's dependencies. | ||
DependencyTrait::addDependencies | protected | function | Adds multiple dependencies. | ||
DependencyTrait::addDependency | protected | function | Adds a dependency. | ||
MessengerTrait::$messenger | protected | property | The messenger. | 25 | |
MessengerTrait::messenger | public | function | Gets the messenger. | 25 | |
MessengerTrait::setMessenger | public | function | Sets the messenger. | ||
PluginBase::$configuration | protected | property | Configuration information passed into the plugin. | 1 | |
PluginBase::$pluginDefinition | protected | property | The plugin implementation definition. | 1 | |
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 | 2 |
PluginBase::getPluginId | public | function | Gets the plugin ID of the plugin instance. | Overrides PluginInspectionInterface::getPluginId | |
PluginBase::isConfigurable | public | function | Determines if the plugin is configurable. | ||
Role::fields | public | function | Returns available fields on the source. | ||
Role::getIds | public | function | Defines the source fields uniquely identifying a source row. | ||
Role::prepareRow | public | function | Adds additional data to the row. | ||
Role::query | public | function | |||
StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | |
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. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.