You are here

public function DBDeriver::getDerivativeDefinitions in Drupal 7 to 8/9 Module Upgrader 8

Same name in this branch
  1. 8 src/Plugin/DMU/Analyzer/DBDeriver.php \Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\DBDeriver::getDerivativeDefinitions()
  2. 8 src/Plugin/DMU/Converter/Functions/DBDeriver.php \Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions\DBDeriver::getDerivativeDefinitions()

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 DeriverInterface::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/DMU/Converter/Functions/DBDeriver.php, line 15

Class

DBDeriver
Builds derivative definitions for the _db plugin.

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions

Code

public function getDerivativeDefinitions($base_definition) {
  $derivatives = [];
  $functions = [
    'db_select',
    'db_insert',
    'db_update',
    'db_merge',
    'db_delete',
    'db_truncate',
  ];
  foreach ($functions as $function) {
    $variables = [
      '@function' => $function,
    ];
    $derivative = $base_definition;
    $derivative['function'] = $function;
    $derivative['description'] = $this
      ->t('Disables calls to @function() which refer to legacy tables.', $variables);
    $derivatives[$function] = $derivative;
  }
  return $derivatives;
}