entity_load_multiple_by_properties($entity_type, array $values)
Load entities by their property values.
\Drupal::entityTypeManager()
->getStorage($entity_type)
->loadByProperties($values);
Parameters
string $entity_type: The entity type to load, e.g. node or user.
array $values: An associative array where the keys are the property names and the values are the values those properties must have.
Return value
array An array of entity objects indexed by their IDs. Returns an empty arra