From 99d4311eb670d82483c20b818a3ae48b865a3a8d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 17 Jan 2024 11:03:26 +0000 Subject: [PATCH] Only load post nodes --- web/modules/custom/example/src/Repository/PostNodeRepository.php | 1 + 1 file changed, 1 insertion(+) diff --git a/web/modules/custom/example/src/Repository/PostNodeRepository.php b/web/modules/custom/example/src/Repository/PostNodeRepository.php index 575312f..b8a8c8c 100644 --- a/web/modules/custom/example/src/Repository/PostNodeRepository.php +++ b/web/modules/custom/example/src/Repository/PostNodeRepository.php @@ -19,6 +19,7 @@ final class PostNodeRepository { $nodeStorage = $this->entityTypeManager->getStorage('node'); $nodes = $nodeStorage->loadByProperties([ 'status' => TRUE, + 'type' => 'post', ]); uasort($nodes, function (NodeInterface $a, NodeInterface $b): int {