/** * Static Constructor * * @param Faker\Project the DI container * @param string $name of the entity * @param Faker\Locale\LocaleInterface $locale to use * @param Faker\Components\Engine\Common\Utilities $util * @param PHPStats\Generator\GeneratorInterface $util */ public static function create(Project $container, $name, LocaleInterface $locale = null, Utilities $util = null, GeneratorInterface $gen = null) { $repo = $container->getEngineTypeRepository(); $event = $container->getEventDispatcher(); $conn = $container->getGeneratorDatabase(); $loader = $container->getTemplatingManager()->getLoader(); $platformFactory = $container->getDBALPlatformFactory(); $formatterFactory = $container->getFormatterFactory($event); $compiler = $container->getEngineCompiler(); $datasourceRepo = $container->getDatasourceRepository(); if ($locale === null) { $locale = $container->getLocaleFactory()->create('en'); } if ($util === null) { $util = $container->getEngineUtilities(); } if ($gen === null) { $gen = $container->getDefaultRandom(); } return new self($name, $event, $repo, $locale, $util, $gen, $conn, $loader, $platformFactory, $formatterFactory, $compiler, $datasourceRepo); }