/** * Create a new factory with basic settings from the environment. * * This factory can be used to create a new Container, Environment, DcGeneral with the same base settings as the * given environment. * * @param EnvironmentInterface $environment The environment to use as base. * * @return DcGeneralFactory */ public static function deriveEmptyFromEnvironment(EnvironmentInterface $environment) { $factory = new DcGeneralFactory(); $factory->setEventPropagator($environment->getEventPropagator()); $factory->setTranslator($environment->getTranslator()); $factory->setEnvironmentClassName(get_class($environment)); $factory->setContainerClassName(get_class($environment->getDataDefinition())); return $factory; }