Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Converter / Functions / LoadMultipleDeriver.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 _load_multiple plugin.
9  */
10 class LoadMultipleDeriver extends DeriverBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function getDerivativeDefinitions($base_definition) {
16     $derivatives = [];
17
18     foreach (['node', 'user', 'comment', 'taxonomy_term'] as $entity_type) {
19       $function = $entity_type . '_load_multiple';
20       $variables = ['@function' => $function];
21
22       $derivative = $base_definition;
23       $derivative['function'] = $function;
24       $derivative['entity_type'] = $entity_type;
25       $derivative['message'] = $this->t('`@function` is now `EntityStorageInterface::loadMultiple()`.', $variables);
26       $derivative['description'] = $this->t('Rewrites calls to @function().', $variables);
27
28       $derivatives[$entity_type] = $derivative;
29     }
30
31     return $derivatives;
32   }
33
34 }