Mercurial > hg > isophonics-drupal-site
annotate core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 129ea1e6d783 |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\views\Plugin\Derivative; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Component\Plugin\Derivative\DeriverBase; |
Chris@0 | 6 use Drupal\views\Views; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * A derivative class which provides automatic wizards for all base tables. |
Chris@0 | 10 * |
Chris@0 | 11 * The derivatives store all base table plugin information. |
Chris@0 | 12 */ |
Chris@0 | 13 class DefaultWizardDeriver extends DeriverBase { |
Chris@0 | 14 /** |
Chris@0 | 15 * {@inheritdoc} |
Chris@0 | 16 */ |
Chris@0 | 17 public function getDerivativeDefinitions($base_plugin_definition) { |
Chris@0 | 18 $views_data = Views::viewsData(); |
Chris@0 | 19 $base_tables = array_keys($views_data->fetchBaseTables()); |
Chris@0 | 20 $this->derivatives = []; |
Chris@0 | 21 foreach ($base_tables as $table) { |
Chris@0 | 22 $views_info = $views_data->get($table); |
Chris@0 | 23 if (empty($views_info['table']['wizard_id'])) { |
Chris@0 | 24 $this->derivatives[$table] = [ |
Chris@0 | 25 'id' => 'standard', |
Chris@0 | 26 'base_table' => $table, |
Chris@0 | 27 'title' => $views_info['table']['base']['title'], |
Chris@0 | 28 'class' => 'Drupal\views\Plugin\views\wizard\Standard' |
Chris@0 | 29 ]; |
Chris@0 | 30 } |
Chris@0 | 31 } |
Chris@0 | 32 return parent::getDerivativeDefinitions($base_plugin_definition); |
Chris@0 | 33 } |
Chris@0 | 34 |
Chris@0 | 35 } |