/**
  * EntityManager constructor.
  *
  * @param Configuration $configuration
  */
 public function __construct(Configuration $configuration)
 {
     $this->configuration = $configuration;
     $this->metadataFactory = $configuration->getMetadataFactory();
     $this->metadataFactory->setEntityManager($this);
     $this->unitOfWork = new UnitOfWork($this);
     $this->proxyFactory = new ProxyFactory($this);
     if (null !== ($cache = $this->configuration->getApiCache())) {
         $this->entityCache = new ApiEntityCache($this, $cache, $this->configuration->getApiCacheLogger());
     }
 }