function ViewUIConverter::convert
Same name in this branch
- 8.9.x core/modules/views_ui/src/ProxyClass/ParamConverter/ViewUIConverter.php \Drupal\views_ui\ProxyClass\ParamConverter\ViewUIConverter::convert()
Same name in other branches
- 9 core/modules/views_ui/src/ProxyClass/ParamConverter/ViewUIConverter.php \Drupal\views_ui\ProxyClass\ParamConverter\ViewUIConverter::convert()
- 9 core/modules/views_ui/src/ParamConverter/ViewUIConverter.php \Drupal\views_ui\ParamConverter\ViewUIConverter::convert()
- 10 core/modules/views_ui/src/ProxyClass/ParamConverter/ViewUIConverter.php \Drupal\views_ui\ProxyClass\ParamConverter\ViewUIConverter::convert()
- 10 core/modules/views_ui/src/ParamConverter/ViewUIConverter.php \Drupal\views_ui\ParamConverter\ViewUIConverter::convert()
- 11.x core/modules/views_ui/src/ProxyClass/ParamConverter/ViewUIConverter.php \Drupal\views_ui\ProxyClass\ParamConverter\ViewUIConverter::convert()
- 11.x core/modules/views_ui/src/ParamConverter/ViewUIConverter.php \Drupal\views_ui\ParamConverter\ViewUIConverter::convert()
Overrides AdminPathConfigEntityConverter::convert
File
-
core/
modules/ views_ui/ src/ ParamConverter/ ViewUIConverter.php, line 72
Class
- ViewUIConverter
- Provides upcasting for a view entity to be used in the Views UI.
Namespace
Drupal\views_ui\ParamConverterCode
public function convert($value, $definition, $name, array $defaults) {
if (!($entity = parent::convert($value, $definition, $name, $defaults))) {
return;
}
// Get the temp store for this variable if it needs one. Attempt to load the
// view from the temp store, synchronize its status with the existing view,
// and store the lock metadata.
$store = $this->tempStoreFactory
->get('views');
if ($view = $store->get($value)) {
if ($entity->status()) {
$view->enable();
}
else {
$view->disable();
}
$view->setLock($store->getMetadata($value));
}
else {
$view = new ViewUI($entity);
}
return $view;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.