TaxonomyTermLoadMultipleByNameRector
Refactor function call to an entity storage method
-$terms = taxonomy_term_load_multiple_by_name(
- 'Foo',
- 'topics'
-);
+$terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties([
+ 'name' => 'Foo',
+ 'vid' => 'topics',
+]);
Configure your rector.php:
<?php
use DrupalRector\Drupal9\Rector\Deprecation\TaxonomyTermLoadMultipleByNameRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
TaxonomyTermLoadMultipleByNameRector::class,
]);