You are here

class LoadMultipleDeriver in Drupal 7 to 8/9 Module Upgrader 8

Builds derivative definitions for the _load_multiple plugin.

Hierarchy

Expanded class hierarchy of LoadMultipleDeriver

File

src/Plugin/DMU/Converter/Functions/LoadMultipleDeriver.php, line 10

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions
View source
class LoadMultipleDeriver extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_definition) {
    $derivatives = [];
    foreach ([
      'node',
      'user',
      'comment',
      'taxonomy_term',
    ] as $entity_type) {
      $function = $entity_type . '_load_multiple';
      $variables = [
        '@function' => $function,
      ];
      $derivative = $base_definition;
      $derivative['function'] = $function;
      $derivative['entity_type'] = $entity_type;
      $derivative['message'] = $this
        ->t('`@function` is now `EntityStorageInterface::loadMultiple()`.', $variables);
      $derivative['description'] = $this
        ->t('Rewrites calls to @function().', $variables);
      $derivatives[$entity_type] = $derivative;
    }
    return $derivatives;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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
LoadMultipleDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverInterface::getDerivativeDefinitions
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.