protected function ViewsEntitySchemaSubscriber::dataTableRemoval in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::dataTableRemoval()
- 9 core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::dataTableRemoval()
Updates views if a data table is removed.
Parameters
\Drupal\views\Entity\View[] $all_views: All views.
string $entity_type_id: The entity type ID.
string $old_data_table: The name of the previous existing data table.
string $base_table: The name of the base table.
File
- core/
modules/ views/ src/ EventSubscriber/ ViewsEntitySchemaSubscriber.php, line 392
Class
- ViewsEntitySchemaSubscriber
- Reacts to changes on entity types to update all views entities.
Namespace
Drupal\views\EventSubscriberCode
protected function dataTableRemoval($all_views, $entity_type_id, $old_data_table, $base_table) {
// We move back the data table back to the base table.
$this
->processHandlers($all_views, function (&$handler_config, ViewEntityInterface $view) use ($entity_type_id, $old_data_table, $base_table) {
if (isset($handler_config['entity_type']) && $handler_config['entity_type'] == $entity_type_id) {
if ($handler_config['table'] == $old_data_table) {
$handler_config['table'] = $base_table;
$this->viewsToSave[$view
->id()] = $view;
}
}
});
}