a2616e8e8f2139d25eae451f74b9cb4fd0586048
[yaffs-website] / web / core / modules / views / src / Plugin / Derivative / DefaultWizardDeriver.php
1 <?php
2
3 namespace Drupal\views\Plugin\Derivative;
4
5 use Drupal\Component\Plugin\Derivative\DeriverBase;
6 use Drupal\views\Views;
7
8 /**
9  * A derivative class which provides automatic wizards for all base tables.
10  *
11  * The derivatives store all base table plugin information.
12  */
13 class DefaultWizardDeriver extends DeriverBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getDerivativeDefinitions($base_plugin_definition) {
19     $views_data = Views::viewsData();
20     $base_tables = array_keys($views_data->fetchBaseTables());
21     $this->derivatives = [];
22     foreach ($base_tables as $table) {
23       $views_info = $views_data->get($table);
24       if (empty($views_info['table']['wizard_id'])) {
25         $this->derivatives[$table] = [
26           'id' => 'standard',
27           'base_table' => $table,
28           'title' => $views_info['table']['base']['title'],
29           'class' => 'Drupal\views\Plugin\views\wizard\Standard',
30         ];
31       }
32     }
33     return parent::getDerivativeDefinitions($base_plugin_definition);
34   }
35
36 }