You are here

class DBDeriver 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
  2. 8 src/Plugin/DMU/Converter/Functions/DBDeriver.php \Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions\DBDeriver

Builds derivative definitions for the _db plugin.

Hierarchy

Expanded class hierarchy of DBDeriver

File

src/Plugin/DMU/Analyzer/DBDeriver.php, line 10

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer
View source
class DBDeriver extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_definition) {
    $derivatives = [];
    $functions = [
      'db_select',
      'db_insert',
      'db_update',
      'db_merge',
      'db_truncate',
    ];
    foreach ($functions as $function) {
      $derivative = $base_definition;
      $derivative['function'] = $function;
      $derivative['description'] = $this
        ->t('Checks for calls to @function() that refer to legacy tables.', [
        '@function' => $function,
      ]);
      $derivatives[$function] = $derivative;
    }
    return $derivatives;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DBDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverInterface::getDerivativeDefinitions
DeriverBase::create public static function Creates a new class instance. Overrides ContainerDeriverInterface::create 3
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
DeriverBase::__construct public function 3
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.