LoadMultipleDeriver.php in Drupal 7 to 8/9 Module Upgrader 8
File
src/Plugin/DMU/Converter/Functions/LoadMultipleDeriver.php
View source
<?php
namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
use Drupal\drupalmoduleupgrader\DeriverBase;
class LoadMultipleDeriver extends DeriverBase {
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;
}
}