4f: Use node storage within getAll()

This commit is contained in:
Oliver Davies 2020-11-14 09:09:43 +00:00
parent f38f21fdc8
commit 4dbb334a6f

View file

@ -2,10 +2,18 @@
namespace Drupal\my_module\Repository;
use Drupal\Core\Entity\EntityTypeManagerInterface;
class ArticleRepository {
private $nodeStorage;
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
$this->nodeStorage = $entityTypeManager->getStorage('node');
}
public function getAll(): array {
return [];
return $this->nodeStorage->loadMultiple();
}
}