From 76a19ff21b6522adf80da481bfc5f67c40bfa4d0 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 19 Mar 2020 21:28:10 +0000 Subject: [PATCH] 4i: Ensure only articles are returned Update the `getAll()` method on the article repository to only return article nodes. --- .../custom/my_module/src/Repository/ArticleRepository.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/modules/custom/my_module/src/Repository/ArticleRepository.php b/web/modules/custom/my_module/src/Repository/ArticleRepository.php index 65cef77..3da6051 100644 --- a/web/modules/custom/my_module/src/Repository/ArticleRepository.php +++ b/web/modules/custom/my_module/src/Repository/ArticleRepository.php @@ -16,7 +16,9 @@ class ArticleRepository { } public function getAll(): array { - return $this->nodeStorage->loadMultiple(); + return $this->nodeStorage->loadByProperties([ + 'type' => 'article', + ]); } }