class Extension
Same name in this branch
- 9 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension
Same name and namespace in other branches
- 11.x core/modules/system/src/Plugin/migrate/source/Extension.php \Drupal\system\Plugin\migrate\source\Extension
- 11.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension
Drupal 6/7 system data for a legacy extension source from database.
Available configuration keys:
- name: (optional) The extension name to filter items retrieved from the source - can be a string or an array. If omitted, all extensions are retrieved.
Examples:
source:
plugin: extension
name: node
In this example the system data for node module is retrieved from the source database.
For additional configuration keys, refer to the parent classes.
Plugin annotation
@MigrateSource(
id = "extension",
source_module = "system"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase extends \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface implements \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase extends \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait implements \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\system\Plugin\migrate\source\Extension implements \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase extends \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait implements \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface implements \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase extends \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of Extension
See also
\Drupal\migrate\Plugin\migrate\source\SqlBase
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase
7 string references to 'Extension'
- ConvertImageEffect::submitConfigurationForm in core/
modules/ image/ src/ Plugin/ ImageEffect/ ConvertImageEffect.php - d6_language_content_menu_settings.yml in core/
modules/ language/ migrations/ d6_language_content_menu_settings.yml - core/modules/language/migrations/d6_language_content_menu_settings.yml
- d7_language_content_menu_settings.yml in core/
modules/ language/ migrations/ d7_language_content_menu_settings.yml - core/modules/language/migrations/d7_language_content_menu_settings.yml
- FileViewsData::getViewsData in core/
modules/ file/ src/ FileViewsData.php - Returns views data for the entity type.
- file_test_file_url_alter in core/
modules/ file/ tests/ file_test/ file_test.module - Implements hook_file_url_alter().
File
-
core/
modules/ system/ src/ Plugin/ migrate/ source/ Extension.php, line 37
Namespace
Drupal\system\Plugin\migrate\sourceView source
class Extension extends DrupalSqlBase {
/**
* {@inheritdoc}
*/
public function query() {
$query = $this->select('system', 's')
->fields('s');
if (isset($this->configuration['name'])) {
$query->condition('name', (array) $this->configuration['name'], 'IN');
}
return $query;
}
/**
* {@inheritdoc}
*/
public function fields() {
$fields = [
'filename' => $this->t('Filename'),
'name' => $this->t('Name'),
'type' => $this->t('Type'),
'owner' => $this->t('Owner'),
'status' => $this->t('Status'),
'throttle' => $this->t('Throttle'),
'bootstrap' => $this->t('Bootstrap'),
'schema_version' => $this->t('Schema version'),
'weight' => $this->t('Weight'),
'info' => $this->t('Information array'),
];
return $fields;
}
/**
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
$row->setSourceProperty('info', unserialize($row->getSourceProperty('info')));
return parent::prepareRow($row);
}
/**
* {@inheritdoc}
*/
public function getIds() {
$ids['name']['type'] = 'string';
return $ids;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.