Commit 43997091 authored by webchick's avatar webchick

Issue #2066535 by tim.plunkett, jsst, Berdir: Add EntityManagerInterface and...

Issue #2066535 by tim.plunkett, jsst, Berdir: Add EntityManagerInterface and stop typehinting with EntityManager.
parent 9d5aefb7
......@@ -19,13 +19,14 @@
*
* @return array
* An array containing the entity type's definition, as retrieved with
* \Drupal\Core\Entity\EntityManager. If $entity_type is NULL, an associative
* array of all entity type definitions keyed by entity type is returned.
* \Drupal\Core\Entity\EntityManagerInterface. If $entity_type is NULL, an
* associative array of all entity type definitions keyed by entity type is
* returned.
*
* @see \Drupal\Core\Entity\EntityManager
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see hook_entity_info_alter()
*
* @deprecated Use \Drupal\Core\Entity\EntityManager::getDefinitions() directly.
* @deprecated Use \Drupal\Core\Entity\EntityManagerInterface::getDefinitions() directly.
*/
function entity_get_info($entity_type = NULL) {
if (empty($entity_type)) {
......@@ -68,8 +69,8 @@ function entity_render_cache_clear() {
* @return array
* The bundle info for a specific entity type, or all entity types.
*
* @see \Drupal\Core\Entity\EntityManager::getBundleInfo()
* @see \Drupal\Core\Entity\EntityManager::getAllBundleInfo()
* @see \Drupal\Core\Entity\EntityManagerInterface::getBundleInfo()
* @see \Drupal\Core\Entity\EntityManagerInterface::getAllBundleInfo()
*/
function entity_get_bundles($entity_type = NULL) {
if (isset($entity_type)) {
......@@ -195,7 +196,7 @@ function entity_get_view_modes($entity_type = NULL) {
* @return \Drupal\Core\Entity\EntityInterface
* The entity object, or NULL if there is no entity with the given id.
*
* @see \Drupal\Core\Entity\EntityManager
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageControllerInterface
* @see \Drupal\Core\Entity\DatabaseStorageController
* @see \Drupal\Core\Entity\Query\QueryInterface
......@@ -220,7 +221,7 @@ function entity_load($entity_type, $id, $reset = FALSE) {
* The entity object, or FALSE if there is no entity with the given revision
* id.
*
* @see \Drupal\Core\Entity\EntityManager
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageControllerInterface
* @see \Drupal\Core\Entity\DatabaseStorageController
*/
......@@ -262,7 +263,7 @@ function entity_revision_delete($entity_type, $revision_id) {
* @throws \Drupal\Core\Entity\EntityStorageException
* Thrown in case the requested entity type does not support UUIDs.
*
* @see \Drupal\Core\Entity\EntityManager
* @see \Drupal\Core\Entity\EntityManagerInterface
*/
function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) {
$entity_info = entity_get_info($entity_type);
......@@ -307,7 +308,7 @@ function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) {
* @return array
* An array of entity objects indexed by their ids.
*
* @see \Drupal\Core\Entity\EntityManager
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageControllerInterface
* @see \Drupal\Core\Entity\DatabaseStorageController
* @see \Drupal\Core\Entity\Query\QueryInterface
......@@ -397,7 +398,7 @@ function entity_create($entity_type, array $values) {
*
* @return \Drupal\Core\Entity\EntityStorageControllerInterface
*
* @deprecated Use \Drupal\Core\Entity\EntityManager::getStorageController().
* @deprecated Use \Drupal\Core\Entity\EntityManagerInterface::getStorageController().
*/
function entity_get_controller($entity_type) {
return \Drupal::entityManager()
......@@ -435,7 +436,7 @@ function entity_page_label(EntityInterface $entity, $langcode = NULL) {
* @return \Drupal\Core\Entity\EntityAccessControllerInterface
* An entity access controller instance.
*
* @deprecated Use \Drupal\Core\Entity\EntityManager::getAccessController().
* @deprecated Use \Drupal\Core\Entity\EntityManagerInterface::getAccessController().
*/
function entity_access_controller($entity_type) {
return \Drupal::entityManager()
......@@ -451,7 +452,7 @@ function entity_access_controller($entity_type) {
* used. If a non-existing non-default operation is specified an exception will
* be thrown.
*
* @see \Drupal\Core\Entity\EntityManager
* @see \Drupal\Core\Entity\EntityManagerInterface
*
* @param $entity_type
* The type of the entity.
......@@ -463,7 +464,7 @@ function entity_access_controller($entity_type) {
* @return \Drupal\Core\Entity\EntityFormControllerInterface
* An entity form controller instance.
*
* @deprecated Use \Drupal\Core\Entity\EntityManager::getFormController().
* @deprecated Use \Drupal\Core\Entity\EntityManagerInterface::getFormController().
*/
function entity_form_controller($entity_type, $operation = 'default') {
return \Drupal::entityManager()
......@@ -544,7 +545,7 @@ function entity_get_form(EntityInterface $entity, $operation = 'default', array
* @return \Drupal\Core\Entity\EntityListControllerInterface
* An entity list controller.
*
* @deprecated Use \Drupal\Core\Entity\EntityManager::getFormController().
* @deprecated Use \Drupal\Core\Entity\EntityManagerInterface::getFormController().
*/
function entity_list_controller($entity_type) {
return \Drupal::entityManager()
......
......@@ -169,7 +169,7 @@ public static function currentUser() {
/**
* Retrieves the entity manager service.
*
* @return \Drupal\Core\Entity\EntityManager
* @return \Drupal\Core\Entity\EntityManagerInterface
* The entity manager service.
*/
public static function entityManager() {
......
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Config;
use Drupal\Core\Config\Context\FreeConfigContext;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Component\Uuid\UuidInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
......@@ -70,7 +70,7 @@ class ConfigImporter {
/**
* The plugin manager for entities.
*
* @var \Drupal\Core\Entity\EntityManager
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
......@@ -112,14 +112,14 @@ class ConfigImporter {
* The event dispatcher used to notify subscribers of config import events.
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* The config factory that statically caches config objects.
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager used to import config entities.
* @param \Drupal\Core\Lock\LockBackendInterface
* The lock backend to ensure multiple imports do not occur at the same time.
* @param \Drupal\Component\Uuid\UuidInterface $uuid_service
* The UUID service.
*/
public function __construct(StorageComparerInterface $storage_comparer, EventDispatcherInterface $event_dispatcher, ConfigFactory $config_factory, EntityManager $entity_manager, LockBackendInterface $lock, UuidInterface $uuid_service) {
public function __construct(StorageComparerInterface $storage_comparer, EventDispatcherInterface $event_dispatcher, ConfigFactory $config_factory, EntityManagerInterface $entity_manager, LockBackendInterface $lock, UuidInterface $uuid_service) {
$this->storageComparer = $storage_comparer;
$this->eventDispatcher = $event_dispatcher;
$this->configFactory = $config_factory;
......
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Config\Entity\Query;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\Query\QueryBase;
use Drupal\Core\Entity\Query\QueryInterface;
......@@ -20,7 +20,7 @@ class Query extends QueryBase implements QueryInterface {
/**
* Stores the entity manager.
*
* @var \Drupal\Core\Entity\EntityManager
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
......@@ -39,14 +39,14 @@ class Query extends QueryBase implements QueryInterface {
* @param string $conjunction
* - AND: all of the conditions on the query need to match.
* - OR: at least one of the conditions on the query need to match.
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager that stores all meta information.
* @param \Drupal\Core\Config\StorageInterface $config_storage
* The actual config storage which is used to list all config items.
* @param array $namespaces
* List of potential namespaces of the classes belonging to this query.
*/
function __construct($entity_type, $conjunction, EntityManager $entity_manager, StorageInterface $config_storage, array $namespaces) {
function __construct($entity_type, $conjunction, EntityManagerInterface $entity_manager, StorageInterface $config_storage, array $namespaces) {
parent::__construct($entity_type, $conjunction, $namespaces);
$this->entityManager = $entity_manager;
$this->configStorage = $config_storage;
......
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Config\Entity\Query;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\Query\QueryBase;
use Drupal\Core\Entity\Query\QueryException;
use Drupal\Core\Entity\Query\QueryFactoryInterface;
......@@ -46,14 +46,14 @@ public function __construct(StorageInterface $config_storage) {
/**
* {@inheritdoc}
*/
public function get($entity_type, $conjunction, EntityManager $entity_manager) {
public function get($entity_type, $conjunction, EntityManagerInterface $entity_manager) {
return new Query($entity_type, $conjunction, $entity_manager, $this->configStorage, $this->namespaces);
}
/**
* @inheritdoc
*/
public function getAggregate($entity_type, $conjunction, EntityManager $entity_manager) {
public function getAggregate($entity_type, $conjunction, EntityManagerInterface $entity_manager) {
throw new QueryException('Aggregation over configuration entities is not supported');
}
......
......@@ -33,7 +33,7 @@ abstract class ControllerBase {
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManager
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
......@@ -96,7 +96,7 @@ abstract class ControllerBase {
/**
* Retrieves the entity manager service.
*
* @return \Drupal\Core\Entity\EntityManager
* @return \Drupal\Core\Entity\EntityManagerInterface
* The entity manager service.
*/
protected function entityManager() {
......
......@@ -9,7 +9,7 @@
use Drupal\Component\Utility\Xss;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageManager;
......@@ -45,12 +45,12 @@ class Date {
/**
* Constructs a Date object.
*
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* The language manager.
*/
public function __construct(EntityManager $entity_manager, LanguageManager $language_manager) {
public function __construct(EntityManagerInterface $entity_manager, LanguageManager $language_manager) {
$this->dateFormatStorage = $entity_manager->getStorageController('date_format');
$this->languageManager = $language_manager;
}
......
......@@ -48,10 +48,10 @@ public function initTranslation($langcode);
*
* @return array
* An array of entity field definitions as specified by
* \Drupal\Core\Entity\EntityManager::getFieldDefinitions(), keyed by field
* \Drupal\Core\Entity\EntityManagerInterface::getFieldDefinitions(), keyed by field
* name.
*
* @see \Drupal\Core\Entity\EntityManager::getFieldDefinitions()
* @see \Drupal\Core\Entity\EntityManagerInterface::getFieldDefinitions()
*/
public static function baseFieldDefinitions($entity_type);
......
......@@ -8,8 +8,8 @@
namespace Drupal\Core\Entity\Controller;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -20,17 +20,17 @@ class EntityViewController implements ContainerInjectionInterface {
/**
* The entity manager
*
* @var \Drupal\Core\Entity\EntityManager
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* Creates an EntityListController object.
*
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
*/
public function __construct(EntityManager $entity_manager) {
public function __construct(EntityManagerInterface $entity_manager) {
$this->entityManager = $entity_manager;
}
......
......@@ -20,7 +20,7 @@ class EntityCreateAccessCheck implements StaticAccessCheckInterface {
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManager
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
......@@ -34,10 +34,10 @@ class EntityCreateAccessCheck implements StaticAccessCheckInterface {
/**
* Constructs a EntityCreateAccessCheck object.
*
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
*/
public function __construct(EntityManager $entity_manager) {
public function __construct(EntityManagerInterface $entity_manager) {
$this->entityManager = $entity_manager;
}
......
<?php
/**
* @file
* Contains \Drupal\Core\Entity\EntityManagerInterface.
*/
namespace Drupal\Core\Entity;
use Drupal\Component\Plugin\PluginManagerInterface;
/**
* Provides an interface for entity type managers.
*/
interface EntityManagerInterface extends PluginManagerInterface {
/**
* Builds a list of entity type labels suitable for a Form API options list.
*
* @return array
* An array of entity type labels, keyed by entity type name.
*/
public function getEntityTypeLabels();
/**
* Gets an array of content entity field definitions.
*
* If a bundle is passed, fields specific to this bundle are included. Entity
* fields are always multi-valued, so 'list' is TRUE for each returned field
* definition.
*
* @param string $entity_type
* The entity type to get field definitions for. Only entity types that
* implement \Drupal\Core\Entity\ContentEntityInterface are supported.
* @param string $bundle
* (optional) The entity bundle for which to get field definitions. If NULL
* is passed, no bundle-specific fields are included. Defaults to NULL.
*
* @return array
* An array of field definitions of entity fields, keyed by field
* name. In addition to the typed data definition keys as described at
* \Drupal\Core\TypedData\TypedDataManager::create() the following keys are
* supported:
* - queryable: Whether the field is queryable via QueryInterface.
* Defaults to TRUE if 'computed' is FALSE or not set, to FALSE otherwise.
* - translatable: Whether the field is translatable. Defaults to FALSE.
* - configurable: A boolean indicating whether the field is configurable
* via field.module. Defaults to FALSE.
*
* @see \Drupal\Core\TypedData\TypedDataManager::create()
* @see \Drupal\Core\Entity\EntityManagerInterface::getFieldDefinitionsByConstraints()
*/
public function getFieldDefinitions($entity_type, $bundle = NULL);
/**
* Creates a new access controller instance.
*
* @param string $entity_type
* The entity type for this access controller.
*
* @return \Drupal\Core\Entity\EntityAccessControllerInterface.
* A access controller instance.
*/
public function getAccessController($entity_type);
/**
* Returns the route information for an entity type's bundle.
*
* @param string $entity_type
* The entity type.
* @param string $bundle
* The name of the bundle.
*
* @return array
* An associative array with the following keys:
* - route_name: The name of the route.
* - route_parameters: (optional) An associative array of parameter names
* and values.
*/
public function getAdminRouteInfo($entity_type, $bundle);
/**
* Gets an array of entity field definitions based on validation constraints.
*
* @param string $entity_type
* The entity type to get field definitions for.
* @param array $constraints
* An array of entity constraints as used for entities in typed data
* definitions, i.e. an array optionally including a 'Bundle' key.
* For example the constraints used by an entity reference could be:
*
* @code
* array(
* 'Bundle' => 'article',
* )
* @endcode
*
* @return array
* An array of field definitions of entity fields, keyed by field
* name.
*
* @see \Drupal\Core\Entity\EntityManagerInterface::getFieldDefinitions()
*/
public function getFieldDefinitionsByConstraints($entity_type, array $constraints);
/**
* Creates a new storage controller instance.
*
* @param string $entity_type
* The entity type for this storage controller.
*
* @return \Drupal\Core\Entity\EntityStorageControllerInterface
* A storage controller instance.
*/
public function getStorageController($entity_type);
/**
* Returns an entity controller class.
*
* @param string $entity_type
* The name of the entity type
* @param string $controller_type
* The name of the controller.
* @param string|null $nested
* (optional) If this controller definition is nested, the name of the key.
* Defaults to NULL.
*
* @return string
* The class name for this controller instance.
*/
public function getControllerClass($entity_type, $controller_type, $nested = NULL);
/**
* Get the bundle info of all entity types.
*
* @return array
* An array of all bundle information.
*/
public function getAllBundleInfo();
/**
* Add more namespaces to the entity manager.
*
* This is usually only necessary for uninstall purposes.
*
* @todo Remove this method, along with doDiscovery(), when
* https://drupal.org/node/1199946 is fixed.
*
* @param \Traversable $namespaces
*
* @see comment_uninstall()
*/
public function addNamespaces(\Traversable $namespaces);
/**
* {@inheritdoc}
*/
public function clearCachedDefinitions();
/**
* Creates a new view builder instance.
*
* @param string $entity_type
* The entity type for this view builder.
*
* @return \Drupal\Core\Entity\EntityViewBuilderInterface.
* A render controller instance.
*/
public function getViewBuilder($entity_type);
/**
* Returns the administration path for an entity type's bundle.
*
* @param string $entity_type
* The entity type.
* @param string $bundle
* The name of the bundle.
*
* @return string
* The administration path for an entity type bundle, if it exists.
*/
public function getAdminPath($entity_type, $bundle);
/**
* Creates a new list controller instance.
*
* @param string $entity_type
* The entity type for this list controller.
*
* @return \Drupal\Core\Entity\EntityListControllerInterface
* A list controller instance.
*/
public function getListController($entity_type);
/**
* Creates a new form controller instance.
*
* @param string $entity_type
* The entity type for this form controller.
* @param string $operation
* The name of the operation to use, e.g., 'default'.
*
* @return \Drupal\Core\Entity\EntityFormControllerInterface
* A form controller instance.
*/
public function getFormController($entity_type, $operation);
/**
* Clears static and persistent field definition caches.
*/
public function clearCachedFieldDefinitions();
/**
* Checks whether a certain entity type has a certain controller.
*
* @param string $entity_type
* The name of the entity type.
* @param string $controller_type
* The name of the controller.
*
* @return bool
* Returns TRUE if the entity type has the controller, else FALSE.
*/
public function hasController($entity_type, $controller_type);
/**
* Returns the built and processed entity form for the given entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to be created or edited.
* @param string $operation
* (optional) The operation identifying the form variation to be returned.
* Defaults to 'default'.
* @param array $form_state
* (optional) An associative array containing the current state of the form.
* Use this to pass additional information to the form, such as the
* langcode. Defaults to an empty array.
*
* @code
* $form_state['langcode'] = $langcode;
* $manager = \Drupal::entityManager();
* $form = $manager->getForm($entity, 'default', $form_state);
* @endcode
*
* @return array
* The processed form for the given entity and operation.
*/
public function getForm(EntityInterface $entity, $operation = 'default', array $form_state = array());
/**
* Get the bundle info of an entity type.
*
* @param string $entity_type
* The entity type.
*
* @return array
* Returns the bundle information for the specified entity type.
*/
public function getBundleInfo($entity_type);
}
......@@ -11,8 +11,8 @@
* Defines a common interface for entity controller classes.
*
* All entity controller classes specified via the "controllers['storage']" key
* returned by \Drupal\Core\Entity\EntityManager or hook_entity_info_alter()
* have to implement this interface.
* returned by \Drupal\Core\Entity\EntityManagerInterface or
* hook_entity_info_alter() have to implement this interface.
*
* Most simple, SQL-based entity controllers will do better by extending
* Drupal\Core\Entity\DatabaseStorageController instead of implementing this
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\Entity\Plugin\DataType\Deriver;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -33,7 +33,7 @@ class EntityDeriver implements ContainerDerivativeInterface {
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManager
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
......@@ -42,10 +42,10 @@ class EntityDeriver implements ContainerDerivativeInterface {
*
* @param string $base_plugin_id
* The base plugin ID.
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
*/
public function __construct($base_plugin_id, EntityManager $entity_manager) {
public function __construct($base_plugin_id, EntityManagerInterface $entity_manager) {
$this->basePluginId = $base_plugin_id;
$this->entityManager = $entity_manager;
}
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\Entity\Query;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityManagerInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
/**
......@@ -18,17 +18,17 @@ class QueryFactory extends ContainerAware {
/**
* Stores the entity manager used by the query.
*
* @var \Drupal\Core\Entity\EntityManager
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* Constructs a QueryFactory object.
*
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager used by the query.
*/
public function __construct(EntityManager $entity_manager) {
public function __construct(EntityManagerInterface $entity_manager) {
$this->entityManager = $entity_manager;
}
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\Entity\Query;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Entity\EntityManagerInterface;
/**
* Defines an interface for QueryFactory classes.
......@@ -21,15 +21,15 @@ interface QueryFactoryInterface {
* The entity type for the query.
* @param string $conjunction
* The operator to use to combine conditions: 'AND' or 'OR'.
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager that handles the entity type.
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager that handles the entity type.
*
* @return \Drupal\Core\Entity\Query\QueryInterface
* An entity query for a specific configuration entity type.
*/
public function get($entity_type, $conjunction, EntityManager $entity_manager);
public function get($entity_type, $conjunction, EntityManagerInterface $entity_manager);
/**
* Returns a aggregation query object for a given entity type.
......@@ -39,13 +39,13 @@ public function get($entity_type, $conjunction, EntityManager $entity_manager);
* @param string $conjunction
* - AND: all of the conditions on the query need to match.
* - OR: at least one of the conditions on the query need to match.
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager that handles the entity type.