コード例 #1
0
ファイル: Group.php プロジェクト: Nycto/Round-Eights
 /**
  * Sets the value for this key only if the value hasn't changed in the cache
  * since it was originally pulled
  *
  * @param \r8\Cache\Result $result A result object that was returned by
  *      the getForUpdate method
  * @param mixed $value The value to set
  * @param Integer $expire The lifespan of this cache value, in seconds
  * @return \r8\iface\Cache Returns a self reference
  */
 public function setIfSame(\r8\Cache\Result $result, $value, $expire = 0)
 {
     if (!$this->cache instanceof \r8\iface\Cache\Updatable) {
         throw new \r8\Exception\Data($this->cache, 'Inner Cache', 'Must be an instance of \\r8\\iface\\Cache\\Updatable');
     }
     $this->cache->setIfSame(new \r8\Cache\Result($this->cache, $this->modifyKey($result->getKey()), $result->getHash(), $result->getValue()), $value, $expire);
     return $this;
 }
コード例 #2
0
ファイル: Suffix.php プロジェクト: Nycto/Round-Eights
 /**
  * Deletes all values in the cache
  *
  * @return \r8\Cache\Suffix Returns a self reference
  */
 public function flush()
 {
     $this->inner->flush();
     return $this;
 }
コード例 #3
0
ファイル: Layered.php プロジェクト: Nycto/Round-Eights
 /**
  * Deletes all values in the cache
  *
  * @return \r8\Cache\Layered Returns a self reference
  */
 public function flush()
 {
     $this->primary->flush();
     $this->secondary->flush();
     return $this;
 }
コード例 #4
0
ファイル: Result.php プロジェクト: Nycto/Round-Eights
 /**
  * Sets the value for this key only if the value hasn't changed in the cache
  * since it was originally pulled
  *
  * @param mixed $value The new value
  * @param Integer $expire The lifespan of this cache value, in seconds
  * @return \r8\Cache\Result Returns a self reference
  */
 public function setIfSame($value, $expire = 0)
 {
     $this->cache->setIfSame($this, $value, $expire);
     return $this;
 }
コード例 #5
0
ファイル: Value.php プロジェクト: Nycto/Round-Eights
 /**
  * Decrements this value by one
  *
  * @return \r8\Cache\Value Returns a self reference
  */
 public function decrement()
 {
     $this->cache->decrement($this->key);
     return $this;
 }