public function __invoke() { $registry = Registry::getInstance(); foreach ($this->items as $key => $value) { $registry[$key] = $value; } }
private function __getLoader() { $registry = Registry::getInstance(); if (!isset($registry[Registry::KEY_LAZY_LOADER_FACTORY])) { return false; } $loaderFactory = $registry[Registry::KEY_LAZY_LOADER_FACTORY]; return $loaderFactory->getInstance(get_called_class()); }
public function getLogger() { static $logger; if (null === $logger) { $registry = Registry::getInstance(); if (isset($registry[Registry::KEY_LOGGER])) { $logger = $registry[Registry::KEY_LOGGER]->getInstance(get_called_class()); } else { $logger = false; } } return $logger; }
public function flush() { Registry::getInstance()->flush(); }
private function registerLazyLoader() { $lazyLoaderFactory = new LazyLoaderFactory($this->objectManager); Registry::getInstance()[Registry::KEY_LAZY_LOADER_FACTORY] = $lazyLoaderFactory; }
private function initializeRegistry(ObjectManager $objectManager, LoggerInterface $logger = null) { if (null !== $logger) { Registry::getInstance()[Registry::KEY_LOGGER] = $logger; } $lazyLoaderFactory = new LazyLoaderFactory($objectManager); Registry::getInstance()[Registry::KEY_LAZY_LOADER_FACTORY] = $lazyLoaderFactory; }