Ejemplo n.º 1
0
 public function testBuildCommand()
 {
     $counter = new CounterUpdate();
     $builder = StoreMap::builder($this->location, [])->withLocation($this->location)->withContext('context-hash')->removeMap('map_key_remove')->removeSet('set_key_remove')->removeFlag('flag_key_remove')->removeCounter('map_counter_remove')->removeRegister('map_register_remove')->updateMap('map_key', MapUpdate::create())->updateSet('set_key', SetUpdate::create())->updateRegister('map_register', 'foo')->updateCounter('map_counter', 1)->updateFlag('flag_key', true)->withContext('context-hash')->withReturnBody(true)->withDw(1)->withPw(2)->withW(3);
     $counter->withDelta(1);
     $builder->updateCounter('other_counter', $counter);
     $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\StoreMap', $builder->build());
 }
Ejemplo n.º 2
0
 /**
  * Update the map in Riak by adding/updating the set mapped to the provided key.
  *
  * @param string                                        $key
  * @param \Riak\Client\Command\DataType\SetUpdate|array $value
  *
  * @return \Riak\Client\Command\DataType\StoreMap
  */
 public function updateSet($key, $value)
 {
     $update = !$value instanceof SetUpdate ? SetUpdate::createFromArray($value) : $value;
     $this->update->updateSet($key, $update->getOp());
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * Remove the provided value from the set in Riak.
  *
  * @param mixed $value
  *
  * @return \Riak\Client\Command\DataType\StoreSet
  */
 public function remove($value)
 {
     $this->update->remove($value);
     return $this;
 }