Commit f654024c authored by alexpott's avatar alexpott
Browse files

Issue #2295383 by g3r4 | joachim: Fixed...

Issue #2295383 by g3r4 | joachim: Fixed EntityStorageInterface::loadByProperties() needs to say what it returns when nothing found.
parent 3a0b12c4
......@@ -85,8 +85,8 @@ function entity_invoke_bundle_hook($hook, $entity_type, $bundle, $bundle_new = N
* @param bool $reset
* Whether to reset the internal cache for the requested entity type.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity object, or NULL if there is no entity with the given id.
* @return \Drupal\Core\Entity\EntityInterface|null
* The entity object, or NULL if there is no entity with the given ID.
*
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageInterface
......@@ -188,7 +188,7 @@ function entity_load_by_uuid($entity_type_id, $uuid) {
* Whether to reset the internal cache for the requested entity type.
*
* @return array
* An array of entity objects indexed by their ids.
* An array of entity objects indexed by their IDs.
*
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageInterface
......@@ -213,7 +213,8 @@ function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) {
* values are the values those properties must have.
*
* @return array
* An array of entity objects indexed by their ids.
* An array of entity objects indexed by their IDs. Returns an empty array if
* no matching entities found.
*/
function entity_load_multiple_by_properties($entity_type, array $values) {
return \Drupal::entityManager()
......
......@@ -45,8 +45,9 @@ public function resetCache(array $ids = NULL);
* @param $ids
* An array of entity IDs, or NULL to load all entities.
*
* @return
* An array of entity objects indexed by their ids.
* @return array
* An array of entity objects indexed by their IDs. Returns an empty array
* if no matching entities found.
*/
public function loadMultiple(array $ids = NULL);
......@@ -56,8 +57,8 @@ public function loadMultiple(array $ids = NULL);
* @param mixed $id
* The ID of the entity to load.
*
* @return \Drupal\Core\Entity\EntityInterface
* An entity object.
* @return \Drupal\Core\Entity\EntityInterface|null
* An entity object. NULL if no matching entity is found.
*/
public function load($id);
......@@ -67,8 +68,8 @@ public function load($id);
* @param mixed $id
* The ID of the entity to load.
*
* @return \Drupal\Core\Entity\EntityInterface
* The unchanged entity, or FALSE if the entity cannot be loaded.
* @return \Drupal\Core\Entity\EntityInterface|null
* The unchanged entity, or NULL if the entity cannot be loaded.
*
* @todo Remove this method once we have a reliable way to retrieve the
* unchanged entity from the entity object.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment