protected function loadExtraData() {

    // If URL and token are empty, we are dealing with
    // a local item that has not been saved, and was not
    // created with Container::createContainer(). We treat
    // this as an error condition.
    if (empty($this->url) || empty($this->token)) {
      throw new \HPCloud\Exception('Remote data cannot be fetched. Tokena and endpoint URL are required.');
    }
    // Do a GET on $url to fetch headers.
    $client = \HPCloud\Transport::instance();
    $headers = array(
      'X-Auth-Token' => $this->token,
    );
    $response = $client->doRequest($this->url, 'GET', $headers);

    // Get ACL.
    $this->acl = ACL::newFromHeaders($response->headers());

    // Update size and count.
    $this->bytes = $response->header('X-Container-Bytes-Used', 0);
    $this->count = $response->header('X-Container-Object-Count', 0);

    // Get metadata.
    $prefix = Container::CONTAINER_METADATA_HEADER_PREFIX;
    $this->setMetadata(Container::extractHeaderAttributes($response->headers(), $prefix));

    return $this;
  }
protected function loadExtraData() {

    // If URL and token are empty, we are dealing with
    // a local item that has not been saved, and was not
    // created with Container::createContainer(). We treat
    // this as an error condition.
    if (empty($this->url) || empty($this->token)) {
      throw new \HPCloud\Exception('Remote data cannot be fetched. Tokena and endpoint URL are required.');
    }
    // Do a GET on $url to fetch headers.
    $client = \HPCloud\Transport::instance();
    $headers = array(
      'X-Auth-Token' => $this->token,
    );
    $response = $client->doRequest($this->url, 'GET', $headers);

    // Get ACL.
    $this->acl = ACL::newFromHeaders($response->headers());

    // Update size and count.
    $this->bytes = $response->header('X-Container-Bytes-Used', 0);
    $this->count = $response->header('X-Container-Object-Count', 0);

    // Get metadata.
    $prefix = Container::CONTAINER_METADATA_HEADER_PREFIX;
    $this->setMetadata(Container::extractHeaderAttributes($response->headers(), $prefix));

    return $this;
  }
protected function loadExtraData ( ) { // If URL and token are empty, we are dealing with // a local item that has not been saved, and was not // created with Container::createContainer(). We treat // this as an error condition. if ( empty ( $ this -> url ) || empty ( $ this -> token ) ) { throw new \ HPCloud \ Exception ( 'Remote data cannot be fetched. Tokena and endpoint URL are required.' ) ; } // Do a GET on $url to fetch headers. $ client = \ HPCloud \ Transport :: instance ( ) ; $ headers = array ( 'X-Auth-Token' => $ this -> token , ) ; $ response = $ client -> doRequest ( $ this -> url , 'GET' , $ headers ) ; // Get ACL. $ this -> acl = ACL :: newFromHeaders ( $ response -> headers ( ) ) ; // Update size and count. $ this -> bytes = $ response -> header ( 'X-Container-Bytes-Used' , 0 ) ; $ this -> count = $ response -> header ( 'X-Container-Object-Count' , 0 ) ; // Get metadata. $ prefix = Container :: CONTAINER_METADATA_HEADER_PREFIX ; $ this -> setMetadata ( Container :: extractHeaderAttributes ( $ response -> headers ( ) , $ prefix ) ) ; return $ this ; }
Get missing fields.

Not all containers come fully instantiated. This method is sometimes
called to "fill in" missing fields.

@retval HPCloud::Storage::ObjectStorage::Comtainer
@return \HPCloud\Storage\ObjectStorage\Container
Get missing fields .