name = $name; } /** * @param string $name * @param Configuration $connection * @param Configuration $config * @param EventManager|null $eventManager * @return EntityManager|static * @throws ORMException */ public static function create($connection, Configuration $config, EventManager $eventManager = null, string $name = null) { if (!$config->getMetadataDriverImpl()) { throw ORMException::missingMappingDriverImpl(); } $connection = static::createConnection($connection, $config, $eventManager); return new static($connection, $config, $connection->getEventManager(), $name); } public function getResponsibleEntityManager(string $name): DefaultEntityManager { if ($name !== $this->name) { throw new \RuntimeException("This DefaultEntityManager instance only has em with the name '{$name}'"); } return $this; } }