View::isInstallable

public View::isInstallable()

Checks whether this entity is installable.

For example, a default view might not be installable if the base table doesn't exist.

@retun bool TRUE if the entity is installable, FALSE otherwise.

Overrides ConfigEntityBase::isInstallable

File

core/modules/views/src/Entity/View.php, line 445

Class

View
Defines a View configuration entity class.

Namespace

Drupal\views\Entity

Code

1
2
3
4
5
6
7
public function isInstallable() {
  $table_definition = \Drupal::service('views.views_data')->get($this->base_table);
  // Check whether the base table definition exists and contains a base table
  // definition. For example, taxonomy_views_data_alter() defines
  // node_field_data even if it doesn't exist as a base table.
  return $table_definition && isset($table_definition['table']['base']);
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.