/**
  * Constructor.
  *
  * @param AppInfo $appInfo
  *     See {@link getAppInfo()}
  * @param string $clientIdentifier
  *     See {@link getClientIdentifier()}
  * @param null|string $userLocale
  *     See {@link getUserLocale()}
  */
 function __construct($appInfo, $clientIdentifier, $userLocale = null)
 {
     AppInfo::checkArg("appInfo", $appInfo);
     Checker::argStringNonEmpty("clientIdentifier", $clientIdentifier);
     Checker::argStringNonEmptyOrNull("userLocale", $userLocale);
     $this->appInfo = $appInfo;
     $this->clientIdentifier = $clientIdentifier;
     $this->userLocale = $userLocale;
 }
Ejemplo n.º 2
0
 /**
  * A way of letting you keep up with changes to files and folders in a user's Dropbox.
  *
  * @param string|null $cursor
  *    If this is the first time you're calling this, pass in <code>null</code>.  Otherwise,
  *    pass in whatever cursor was returned by the previous call.
  *
  * @param string|null $pathPrefix
  *    If <code>null</code>, you'll get results for the entire folder (either the user's
  *    entire Dropbox or your App Folder).  If you set <code>$path_prefix</code> to
  *    "/Photos/Vacation", you'll only get results for that path and any files and folders
  *    under it.
  *
  * @return array
  *    A <a href="https://www.dropbox.com/developers/core/docs#delta">delta page</a>, which
  *    contains a list of changes to apply along with a new "cursor" that should be passed into
  *    future <code>getDelta</code> calls.  If the "reset" field is <code>true</code>, you
  *    should clear your local state before applying the changes.  If the "has_more" field is
  *    <code>true</code>, call <code>getDelta</code> immediately to get more results, otherwise
  *    wait a while (at least 5 minutes) before calling <code>getDelta</code> again.
  *
  * @throws Exception
  */
 function getDelta($cursor = null, $pathPrefix = null)
 {
     Checker::argStringNonEmptyOrNull("cursor", $cursor);
     Path::checkArgOrNull("pathPrefix", $pathPrefix);
     $response = $this->doPost($this->apiHost, "1/delta", array("cursor" => $cursor, "path_prefix" => $pathPrefix));
     if ($response->statusCode !== 200) {
         throw RequestUtil::unexpectedStatus($response);
     }
     return RequestUtil::parseResponseJson($response->body);
 }