KeyUtil-value stores support storing values for integer or string keys chosen by the user. Any serializable value can be stored, although an implementation of this interface may further restrict the range of accepted values. See the documentation of the implementation for more information.
Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function getVersions($path, ResourceRepository $repository = null)
 {
     $versions = $this->store->get($path, array());
     if (empty($versions)) {
         throw NoVersionFoundException::forPath($path);
     }
     if (null !== $repository) {
         foreach ($versions as $key => $resource) {
             $resource = clone $resource;
             $resource->attachTo($repository);
             $versions[$key] = $resource;
         }
     }
     return new VersionList($path, $versions);
 }
Exemplo n.º 2
0
 private function loadBindingsForKey($key, $initialize = true)
 {
     $this->bindingsByKey[$key] = $this->store->get('b:' . $key, array());
     if ($initialize) {
         $this->initializeBindings($this->bindingsByKey[$key]);
     }
 }
Exemplo n.º 3
0
 private function loadType($typeName)
 {
     if (!($type = $this->store->get($typeName))) {
         throw NoSuchTypeException::forTypeName($typeName);
     }
     $this->types[$typeName] = $type;
 }
 private function syncBindingsForKey($key)
 {
     if (count($this->bindingsByKey[$key]) > 0) {
         $this->store->set('b:' . $key, $this->bindingsByKey[$key]);
     } else {
         unset($this->bindingsByKey[$key]);
         $this->store->remove('b:' . $key);
     }
 }
 public function testKeysDelegate()
 {
     $this->innerStore->expects($this->once())->method('keys');
     $this->decorator->keys();
 }
 /**
  * {@inheritdoc}
  */
 public function keys()
 {
     return $this->store->keys();
 }