Esempio n. 1
0
 public function addInterests(array $interests)
 {
     $updateSetBuilder = new Riak\Command\Builder\UpdateSet($this->riak);
     foreach ($interests as $interest) {
         $updateSetBuilder->add($interest);
     }
     $response = (new Riak\Command\Builder\UpdateMap($this->riak))->atLocation($this->location)->updateSet('interests', $updateSetBuilder)->withParameter('returnbody', 'true')->build()->execute();
     if ($response->isSuccess()) {
         $this->data = $response->getMap();
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Tests validate properly verifies that remove commands require the context
  *
  * @dataProvider getLocalNodeConnection
  *
  * @param $riak \Basho\Riak
  *
  * @expectedException \Basho\Riak\Command\Builder\Exception
  */
 public function testValidateRemove($riak)
 {
     $builder = new Command\Builder\UpdateSet($riak);
     $builder->remove('some_element');
     $command = $builder->build();
 }