diff --git a/web/modules/custom/example/src/Repository/PostNodeRepository.php b/web/modules/custom/example/src/Repository/PostNodeRepository.php index b7221fc..575312f 100644 --- a/web/modules/custom/example/src/Repository/PostNodeRepository.php +++ b/web/modules/custom/example/src/Repository/PostNodeRepository.php @@ -17,7 +17,9 @@ final class PostNodeRepository { */ public function findAll(): array { $nodeStorage = $this->entityTypeManager->getStorage('node'); - $nodes = $nodeStorage->loadMultiple(); + $nodes = $nodeStorage->loadByProperties([ + 'status' => TRUE, + ]); uasort($nodes, function (NodeInterface $a, NodeInterface $b): int { return $a->getCreatedTime() <=> $b->getCreatedTime();