protected function uncacheClassName($className, SegmentHandler $handler)
 {
     $handler->drop();
     $dao = ClassUtils::callStaticMethod($className . '::dao');
     /* @var $dao StorableDAO */
     return Cache::worker($dao)->uncacheByQuery($dao->makeSelectHead());
 }
 public function uncache()
 {
     foreach ($this->classNameMap as $className => $tags) {
         $dao = ClassUtils::callStaticMethod("{$className}::dao");
         /* @var $dao StorableDAO */
         $worker = Cache::worker($dao);
         Assert::isInstance($worker, TaggableDaoWorker::class);
         $worker->expireTags($tags);
     }
 }
 public function uncache()
 {
     foreach ($this->classNameMap as $className => $uncaches) {
         list($idKeys, $tags) = $uncaches;
         $dao = ClassUtils::callStaticMethod("{$className}::dao");
         /* @var $dao StorableDAO */
         $worker = Cache::worker($dao);
         Assert::isInstance($worker, TaggableDaoWorker::class);
         $worker->expireTags($tags);
         foreach ($idKeys as $key) {
             Cache::me()->mark($className)->delete($key);
         }
         $dao->uncacheLists();
     }
 }
示例#4
0
 public function merge(Identifiable $object, $cacheOnly = true)
 {
     Assert::isNotNull($object->getId());
     $this->checkObjectType($object);
     $old = Cache::worker($this)->getCachedById($object->getId());
     if (!$old) {
         // unlikely
         if ($cacheOnly) {
             return $this->save($object);
         } else {
             $old = Cache::worker($this)->getById($object->getId());
         }
     }
     if ($object === $old) {
         return $this->save($object);
     }
     return $this->unite($object, $old);
 }
示例#5
0
 public function uncacheLists()
 {
     $this->dropIdentityMap();
     return Cache::worker($this)->uncacheLists();
 }