Beispiel #1
0
 /**
  * @param Command $command
  * @param Api $api
  *
  * @return Command\Response
  * @throws Exception
  */
 public function execute(Command $command, Api $api)
 {
     $success = $api->prepare($command, $this)->send();
     if ($success === FALSE) {
         throw new Exception('Command failed to execute against Riak. Error Msg: ' . $api->getError());
     }
     $command->setResponse($api->getStatusCode(), $api->getResponseHeaders(), $api->getResponseBody());
     return $command->getResponse();
 }