function Entity::submitOptionsForm
Same name in this branch
- 9 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::submitOptionsForm()
Same name in other branches
- 8.9.x core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::submitOptionsForm()
- 8.9.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::submitOptionsForm()
- 10 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::submitOptionsForm()
- 10 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::submitOptionsForm()
- 11.x core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::submitOptionsForm()
- 11.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::submitOptionsForm()
Overrides PluginBase::submitOptionsForm
File
-
core/
modules/ views/ src/ Plugin/ views/ area/ Entity.php, line 159
Class
- Entity
- Provides an area handler which renders an entity in a certain view mode.
Namespace
Drupal\views\Plugin\views\areaCode
public function submitOptionsForm(&$form, FormStateInterface $form_state) {
parent::submitOptionsForm($form, $form_state);
// Load the referenced entity and store its config target identifier if
// the target does not contains tokens.
// @todo Use a method to check for tokens in
// https://www.drupal.org/node/2396607.
$options = $form_state->getValue('options');
if (strpos($options['target'], '{{') === FALSE) {
if ($entity = $this->entityTypeManager
->getStorage($this->entityType)
->load($options['target'])) {
$options['target'] = $entity->getConfigTarget();
}
$form_state->setValue('options', $options);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.