setContainer($container); } protected ContainerInterface $container; public function setContainer(ContainerInterface $container): FactoryInterface { $this->container = $container; return $this; } public function getContainer(): ContainerInterface { return $this->container; } public function get(string $repository_class): Repository { return $this->getContainer()->get($repository_class); } }