From 2bcd49e2dbd249f4e36b45a45d713c5f4aeee5c6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 8 Feb 2022 09:41:32 +0000 Subject: [PATCH] refactor: add an import for `NodeInterface` --- README.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a434ef3..cb9c68d 100644 --- a/README.rst +++ b/README.rst @@ -44,15 +44,17 @@ Loading entities by properties .. code:: php + use Drupal\node\NodeInterface; + // Load all published `event` nodes. \Drupal::entityTypeManager()->getStorage('node')->loadByProperties([ - 'status' => \Drupal\node\NodeInterface::PUBLISHED, + 'status' => NodeInterface::PUBLISHED, 'type' => 'event', ]); // Load all published `talk` nodes. \Drupal::entityTypeManager()->getStorage('node')->loadByProperties([ - 'status' => \Drupal\node\NodeInterface::PUBLISHED, + 'status' => NodeInterface::PUBLISHED, 'type' => 'talk', ]);