You are here

public function DataDeriver::getDerivativeDefinitions in Data 8

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Derivative/DataDeriver.php, line 16

Class

DataDeriver
A derivative class which provides automatic wizards for all tables.

Namespace

Drupal\data\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $this->derivatives = array();
  foreach (data_get_all_tables() as $table) {
    $this->derivatives[$table
      ->id()] = array(
      'id' => 'data_table',
      'base_table' => $table
        ->id(),
      'title' => $table
        ->label(),
      'class' => 'Drupal\\data\\Plugin\\views\\wizard\\DataTable',
    );
  }
  return $this->derivatives;
}