4j: Add status condition to getAll()
This commit is contained in:
parent
a540f4ad32
commit
e925409f5f
|
@ -3,6 +3,7 @@
|
|||
namespace Drupal\my_module\Repository;
|
||||
|
||||
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
||||
use Drupal\node\NodeInterface;
|
||||
|
||||
class ArticleRepository {
|
||||
|
||||
|
@ -14,6 +15,7 @@ class ArticleRepository {
|
|||
|
||||
public function getAll(): array {
|
||||
return $this->nodeStorage->loadByProperties([
|
||||
'status' => NodeInterface::PUBLISHED,
|
||||
'type' => 'article',
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue