/**
  * @throws SphringCacheException
  */
 public function run()
 {
     $cacheManager = SphringCacheRunnerPlugin::getInstance()->getCacheManager();
     if ($cacheManager === null) {
         return;
     }
     if (!$cacheManager instanceof AbstractCacheManager) {
         throw new SphringCacheException("Error for bean '%s' cache must be a instance of %s for annotation '%'.", $this->bean->getId(), AbstractCacheManager::class, $this::getAnnotationName());
     }
     $this->cacheManager = $cacheManager;
 }
 /**
  * @return mixed
  */
 public function run()
 {
     $cacheManager = SphringCacheRunnerPlugin::getInstance()->getCacheManager();
     if (empty($cacheManager)) {
         return;
     }
     $this->cacheManager = $cacheManager;
     $this->cacheSphringContext();
     $this->cacheSphringBean();
     $this->removeProxies();
     $this->removeAnnotation();
 }
Пример #3
0
 public function inject()
 {
     if (!is_subclass_of($this->class, AbstractCacheManager::class)) {
         throw new SphringCacheException("Class must be a instance of %s for bean '%'.", AbstractCacheManager::class, $this->id);
     }
     parent::inject();
     $this->object->setCacheSphring($this->cacheSphring);
     $this->object->setCacheSphringProxies($this->cacheSphringProxies);
     $this->object->setCacheSphringContext($this->cacheSphringContext);
     $this->object->setCacheSphringBean($this->cacheSphringBean);
     $this->object->setCacheSphringAnnotation($this->cacheSphringAnnotation);
     SphringCacheRunnerPlugin::getInstance()->setCacheManager($this->object);
 }