Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Converter / Functions / DBDeriver.php
1 <?php
2
3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
4
5 use Drupal\drupalmoduleupgrader\DeriverBase;
6
7 /**
8  * Builds derivative definitions for the _db plugin.
9  */
10 class DBDeriver extends DeriverBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function getDerivativeDefinitions($base_definition) {
16     $derivatives = [];
17
18     $functions = [
19       'db_select', 'db_insert', 'db_update', 'db_merge', 'db_delete', 'db_truncate',
20     ];
21
22     foreach ($functions as $function) {
23       $variables = [
24         '@function' => $function,
25       ];
26       $derivative = $base_definition;
27       $derivative['function'] = $function;
28       $derivative['description'] = $this->t('Disables calls to @function() which refer to legacy tables.', $variables);
29
30       $derivatives[$function] = $derivative;
31     }
32
33     return $derivatives;
34   }
35
36 }