DefaultWizardDeriver.php

Same filename in other branches
  1. 8.9.x core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php
  2. 10 core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php
  3. 11.x core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php

Namespace

Drupal\views\Plugin\Derivative

File

core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php

View source
<?php

namespace Drupal\views\Plugin\Derivative;

use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\views\Views;

/**
 * A derivative class which provides automatic wizards for all base tables.
 *
 * The derivatives store all base table plugin information.
 */
class DefaultWizardDeriver extends DeriverBase {
    
    /**
     * {@inheritdoc}
     */
    public function getDerivativeDefinitions($base_plugin_definition) {
        $views_data = Views::viewsData();
        $base_tables = array_keys($views_data->fetchBaseTables());
        $this->derivatives = [];
        foreach ($base_tables as $table) {
            $views_info = $views_data->get($table);
            if (empty($views_info['table']['wizard_id'])) {
                $this->derivatives[$table] = [
                    'id' => 'standard',
                    'base_table' => $table,
                    'title' => $views_info['table']['base']['title'],
                    'class' => 'Drupal\\views\\Plugin\\views\\wizard\\Standard',
                ];
            }
        }
        return parent::getDerivativeDefinitions($base_plugin_definition);
    }

}

Classes

Title Deprecated Summary
DefaultWizardDeriver A derivative class which provides automatic wizards for all base tables.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.