I'm attempting to understand the concept of entity storage. For example in this tutorial
https://www.sitepoint.com/drupal-8-version-entityfieldquery/
it's using code to load the nodes from nids in a similar way to this
$ids = \Drupal::entityQuery('node')
->condition('status', 1)
->execute();
$node_storage = \Drupal::entityManager()->getStorage('node');
// Load multiple nodes
$node_storage->loadMultiple($ids);
But I'm not sure exactly what this is doing
$node_storage = \Drupal::entityManager()->getStorage('node');
My best guess is that it's loading the format of how the node is stored in the database so it knows how to load everything based on that format, but that's just a guess.
Also side note: the path I normally take is doing a foreach loop on the query results and loading the node based on the nid inside that. Like so. But I'm not sure what's best practice.
foreach ($ids as $nid) {
$node = Node::load($nid);
}
What exactly is entityStorage, and what function is it providing?
loadMultiple
method available