예제 #1
0
 public function __invoke()
 {
     $registry = Registry::getInstance();
     foreach ($this->items as $key => $value) {
         $registry[$key] = $value;
     }
 }
예제 #2
0
 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());
 }
예제 #3
0
 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();
 }
예제 #5
0
 private function registerLazyLoader()
 {
     $lazyLoaderFactory = new LazyLoaderFactory($this->objectManager);
     Registry::getInstance()[Registry::KEY_LAZY_LOADER_FACTORY] = $lazyLoaderFactory;
 }
예제 #6
0
 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;
 }