/**
  * Resolves the dependencies for the given entities.
  *
  * @param string[] $entityClasses
  * @return string[]
  */
 protected function resolve(array $entityClasses)
 {
     $entitiesToCheck = $entityClasses;
     $config = $this->configFactory->createFor($entitiesToCheck);
     while (count($associatedEntities = $this->getDirectlyAssociatedEntities($config, $entitiesToCheck)) > 0) {
         $newAssociations = array_diff($associatedEntities, $entityClasses);
         $entityClasses = array_merge($entityClasses, $newAssociations);
         $config = $this->configFactory->createFor($entityClasses);
         $entitiesToCheck = $newAssociations;
     }
     return $entityClasses;
 }
 /**
  * Creates a new entity manager.
  *
  * @return \Doctrine\ORM\EntityManager
  */
 protected function createEntityManager()
 {
     $config = $this->configFactory->createFor($this->entityClasses);
     $config->setSQLLogger($this->queryLogger);
     return EntityManager::create($this->defaultConnectionParams, $config);
 }