Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function populateFromResponse(ResponseInterface $response) : self
 {
     parent::populateFromResponse($response);
     $this->objectCount = $response->getHeaderLine('X-Container-Object-Count');
     $this->bytesUsed = $response->getHeaderLine('X-Container-Bytes-Used');
     $this->metadata = $this->parseMetadata($response);
     return $this;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function populateFromResponse(ResponseInterface $response) : self
 {
     parent::populateFromResponse($response);
     $this->hash = $response->getHeaderLine('ETag');
     $this->contentLength = $response->getHeaderLine('Content-Length');
     $this->lastModified = $response->getHeaderLine('Last-Modified');
     $this->contentType = $response->getHeaderLine('Content-Type');
     $this->metadata = $this->parseMetadata($response);
     return $this;
 }
Пример #3
0
 public function populateFromArray(array $data) : self
 {
     parent::populateFromArray($data);
     $baseUri = $this->getHttpBaseUrl();
     if (isset($data['file'])) {
         $this->fileUri = Utils::appendPath($baseUri, $data['file']);
     }
     if (isset($data['schema'])) {
         $this->schemaUri = Utils::appendPath($baseUri, $data['schema']);
     }
     return $this;
 }
Пример #4
0
 /**
  * {@inheritDoc}
  */
 public function populateFromResponse(ResponseInterface $response)
 {
     parent::populateFromResponse($response);
     $this->id = $response->getHeaderLine('X-Subject-Token');
     return $this;
 }
Пример #5
0
 public function populateFromResponse(ResponseInterface $response) : self
 {
     parent::populateFromResponse($response);
     $this->metadata = $this->parseMetadata($response);
     return $this;
 }
Пример #6
0
 /**
  * {@inheritDoc}
  */
 public function populateFromArray(array $array) : self
 {
     return parent::populateFromArray(Utils::flattenJson($array, $this->resourceKey));
 }