nodeStorage = $entityTypeManager->getStorage('node'); } public function findAll(): TalkCollection { $talks = $this->nodeStorage->loadByProperties($this->defaultProperties()); return new TalkCollection($talks); } public function findAllPublished(): TalkCollection { $talks = $this->nodeStorage->loadByProperties(array_merge( $this->defaultProperties(), [ 'status' => NodeInterface::PUBLISHED, ], )); return new TalkCollection($talks); } private function defaultProperties(): array { return [ 'type' => 'talk', ]; } }