- Issue created by @twod
- @twod opened merge request.
- Status changed to Needs review
over 1 year ago 9:15pm 15 June 2023
Currently the overrides for entity storage replaces instances of \Drupal::entityTypeManager()->getStorage('')
, but that does not work when using dependency injection to get the Entity Type Manager.
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\taxonomy\TermStorageInterface;
class Foo {
protected TermStorageInterface $termStorage;
public function __construct(
EntityTypeManagerInterface $entityTypeManager,
) {
// PhpStorm will complain that this is an EntityStorageInterface.
$this->termStorage = $entityTypeManager->getStorage('taxonomy_term');
}
}
Replace the override with the interface Drupal\Core\Entity\EntityTypeManagerInterface
.
Needs review
1.0
Code