Beispiel #1
0
 public function __construct($success = true, $code = 0, $message = '', $location = null, $set = null, $date = '')
 {
     parent::__construct($success, $code, $message);
     $this->set = $set;
     $this->location = $location;
     $this->date = $date;
 }
Beispiel #2
0
 public function __construct($statusCode, $headers = [], $body = '')
 {
     parent::__construct($statusCode, $headers, $body);
     // make sure body is not only whitespace
     if (trim($body)) {
         $this->decodeBody($body);
     }
 }
Beispiel #3
0
 public function __construct($statusCode, $headers = [], $body = '')
 {
     parent::__construct($statusCode, $headers, $body);
     // make sure body isn't only whitespace & has a value for the counter
     if (trim($body) && strpos($body, 'value')) {
         // json response
         $body = json_decode(rawurldecode($this->body));
         $this->set = new Set($body->value, $body->context, $this->headers);
     }
 }
Beispiel #4
0
 public function __construct($statusCode, $headers = [], $body = '', $decodeAsAssociative = false)
 {
     parent::__construct($statusCode, $headers, $body);
     $this->decodeAsAssociative = $decodeAsAssociative;
     // make sure body is not only whitespace
     if (trim($body) && !$this->hasSiblings()) {
         $this->parseObject();
     } elseif (trim($body) && $this->hasSiblings()) {
         $this->parseSiblings();
     }
 }
Beispiel #5
0
 public function __construct($statusCode, $headers = [], $body = '', Bucket $bucket = null)
 {
     parent::__construct($statusCode, $headers, $body);
     // make sure body is not only whitespace
     if (trim($body)) {
         $properties = json_decode($this->body, true);
         if ($bucket) {
             $this->bucket = new Bucket($bucket->getName(), $bucket->getType(), $properties['props']);
         }
     }
 }
Beispiel #6
0
 public function __construct($statusCode, $headers = [], $body = '')
 {
     parent::__construct($statusCode, $headers, $body);
     // make sure body is not only whitespace
     $this->results = in_array($this->statusCode, [200, 204]) ? json_decode($body) : null;
     if ($this->results) {
         foreach ($this->results->response->docs as $doc) {
             $this->docs[] = new Doc($doc);
         }
     }
 }
Beispiel #7
0
 public function __construct($success = true, $code = 0, $message = '', $results = [], $termsReturned = false, $continuation = null, $done = true, $date = '')
 {
     parent::__construct($success, $code, $message);
     $this->results = $results;
     $this->termsReturned = $termsReturned;
     $this->continuation = $continuation;
     $this->done = $done;
     $this->date = $date;
     // when timeout is used, cURL returns success for some reason
     if (in_array($code, ['501', '503'])) {
         $this->success = false;
     }
 }
Beispiel #8
0
 public function __construct($success = true, $code = 0, $message = '', $index = null)
 {
     parent::__construct($success, $code, $message);
     $this->index = $index;
 }
Beispiel #9
0
 public function __construct($success = true, $code = 0, $message = '', $rows = [])
 {
     parent::__construct($success, $code, $message);
     $this->rows = $rows;
 }
Beispiel #10
0
 public function __construct($success = true, $code = 0, $message = '', $location = null, $objects = [])
 {
     parent::__construct($success, $code, $message);
     $this->objects = $objects;
     $this->location = $location;
 }
Beispiel #11
0
 public function __construct($success = true, $code = 0, $message = '', $data = [])
 {
     parent::__construct($success, $code, $message);
     $this->stats = $data;
 }
Beispiel #12
0
 public function __construct($success = true, $code = 0, $message = '', $schema = null, $contentType = '')
 {
     parent::__construct($success, $code, $message);
     $this->schema = $schema;
     $this->contentType = $contentType;
 }
Beispiel #13
0
 public function __construct($success = true, $code = 0, $message = '', $results = null)
 {
     parent::__construct($success, $code, $message);
     $this->results = $results;
 }
Beispiel #14
0
 public function __construct($success = true, $code = 0, $message = '', Bucket $bucket = null, $modified = '')
 {
     parent::__construct($success, $code, $message);
     $this->bucket = $bucket;
     $this->modified = $modified;
 }
Beispiel #15
0
 /**
  * Response constructor.
  * @param bool|true $success
  * @param int $code
  * @param string $message
  * @param int $numFound
  * @param \Basho\Riak\Search\Doc[] $docs
  */
 public function __construct($success = true, $code = 0, $message = '', $numFound = 0, $docs = [])
 {
     parent::__construct($success, $code, $message);
     $this->numFound = $numFound;
     $this->docs = $docs;
 }