public static function newFromJSON($data, $token, $url) {

    $object = new RemoteObject($data['name']);
    $object->setContentType($data['content_type']);

    $object->contentLength = (int) $data['bytes'];
    $object->etag = (string) $data['hash'];
    $object->lastModified = strtotime($data['last_modified']);

    $object->token = $token;
    $object->url = $url;

    // FIXME: What do we do about HTTP header data that doesn't come
    // back in JSON?

    return $object;
  }
public static function newFromJSON($data, $token, $url) {

    $object = new RemoteObject($data['name']);
    $object->setContentType($data['content_type']);

    $object->contentLength = (int) $data['bytes'];
    $object->etag = (string) $data['hash'];
    $object->lastModified = strtotime($data['last_modified']);

    $object->token = $token;
    $object->url = $url;

    // FIXME: What do we do about HTTP header data that doesn't come
    // back in JSON?

    return $object;
  }
public static function newFromJSON ( $ data , $ token , $ url ) { $ object = new RemoteObject ( $ data [ 'name' ] ) ; $ object -> setContentType ( $ data [ 'content_type' ] ) ; $ object -> contentLength = ( int ) $ data [ 'bytes' ] ; $ object -> etag = ( string ) $ data [ 'hash' ] ; $ object -> lastModified = strtotime ( $ data [ 'last_modified' ] ) ; $ object -> token = $ token ; $ object -> url = $ url ; // FIXME: What do we do about HTTP header data that doesn't come // back in JSON? return $ object ; }
Create a new RemoteObject from JSON data.

@param array $data
The JSON data as an array.
@param string $token
The authentication token.
@param $url
The URL to the object on the remote server
Create a new RemoteObject from JSON data .