public createInstance ( |
||
$repository |
public function createInstance(InstanceRepository $repository, $className)
{
$instance = new $className();
$this->injectDependencies($repository, $instance);
return $instance;
}
public function singletonInstance(InstanceFactory $factory, $className) { if (isset($this->instances[$className])) { return $this->instances[$className]; } $instance = $factory->createInstance($this, $className); $this->instances[$className] = $instance; return $instance; }