4f: Use node storage within getAll()
This commit is contained in:
parent
f38f21fdc8
commit
4dbb334a6f
|
@ -2,10 +2,18 @@
|
||||||
|
|
||||||
namespace Drupal\my_module\Repository;
|
namespace Drupal\my_module\Repository;
|
||||||
|
|
||||||
|
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
||||||
|
|
||||||
class ArticleRepository {
|
class ArticleRepository {
|
||||||
|
|
||||||
|
private $nodeStorage;
|
||||||
|
|
||||||
|
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
|
||||||
|
$this->nodeStorage = $entityTypeManager->getStorage('node');
|
||||||
|
}
|
||||||
|
|
||||||
public function getAll(): array {
|
public function getAll(): array {
|
||||||
return [];
|
return $this->nodeStorage->loadMultiple();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue