setContainer($container); } protected ContainerInterface $container; public function setContainer(ContainerInterface $container): FactoryInterface { $this->container = $container; return $this; } public function getContainer(): ContainerInterface { return $this->container; } protected string $namespace; public function setNamespace(string $namespace): FactoryInterface { $this->namespace = $namespace; return $this; } public function getNamespace(): string { return $this->namespace; } protected function buildRepository(string $repository_name): string { return implode("\\", [ $this->getNamespace(), $repository_name ]); } public function get(string $repository_name): Repository { return $this->getContainer()->get($this->buildRepository($repository_name)); } }