class Action
Same name in this branch
- 9 core/modules/action/src/Plugin/migrate/source/Action.php \Drupal\action\Plugin\migrate\source\Action
- 9 core/modules/system/src/Entity/Action.php \Drupal\system\Entity\Action
- 9 core/lib/Drupal/Core/Annotation/Action.php \Drupal\Core\Annotation\Action
Same name and namespace in other branches
- 11.x core/modules/system/src/Entity/Action.php \Drupal\system\Entity\Action
- 11.x core/modules/system/src/Plugin/migrate/source/Action.php \Drupal\system\Plugin\migrate\source\Action
- 11.x core/lib/Drupal/Core/Action/Attribute/Action.php \Drupal\Core\Action\Attribute\Action
- 11.x core/lib/Drupal/Core/Annotation/Action.php \Drupal\Core\Annotation\Action
Drupal action source from database.
Plugin annotation
@MigrateSource(
id = "action",
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\Action 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 Action
1 file declares its use of Action
- Action.php in core/
modules/ action/ src/ Plugin/ migrate/ source/ Action.php
33 string references to 'Action'
- action.routing.yml in core/
modules/ action/ action.routing.yml - core/modules/action/action.routing.yml
- ActionAdminManageForm::buildForm in core/
modules/ action/ src/ Form/ ActionAdminManageForm.php - ActionAdminManageForm::submitForm in core/
modules/ action/ src/ Form/ ActionAdminManageForm.php - ActionFormBase::create in core/
modules/ action/ src/ Form/ ActionFormBase.php - ActionListTest::testEmptyActionList in core/
modules/ action/ tests/ src/ Functional/ ActionListTest.php - Tests the behavior when there are no actions to list in the admin page.
File
-
core/
modules/ system/ src/ Plugin/ migrate/ source/ Action.php, line 16
Namespace
Drupal\system\Plugin\migrate\sourceView source
class Action extends DrupalSqlBase {
/**
* {@inheritdoc}
*/
public function query() {
return $this->select('actions', 'a')
->fields('a');
}
/**
* {@inheritdoc}
*/
public function fields() {
$fields = [
'aid' => $this->t('Action ID'),
'type' => $this->t('Module'),
'callback' => $this->t('Callback function'),
'parameters' => $this->t('Action configuration'),
];
if ($this->getModuleSchemaVersion('system') >= 7000) {
$fields['label'] = $this->t('Label of the action');
}
else {
$fields['description'] = $this->t('Action description');
}
return $fields;
}
/**
* {@inheritdoc}
*/
public function getIds() {
$ids['aid']['type'] = 'string';
return $ids;
}
/**
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
$aid = $row->getSourceProperty('aid');
if (is_numeric($aid)) {
if ($this->getModuleSchemaVersion('system') >= 7000) {
$label = $row->getSourceProperty('label');
}
else {
$label = $row->getSourceProperty('description');
}
$row->setSourceProperty('aid', $label);
}
return parent::prepareRow($row);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.