TijsVerkoyen\Dropbox\Dropbox::delta PHP Метод

delta() публичный Метод

A way of letting you keep up with changes to files and folders in a user's Dropbox. You can periodically call /delta to get a list of "delta entries", which are instructions on how to update your local state to match the server's state.
public delta ( string[optional] $cursor = null, string[optional] $locale = null ) : array
$cursor string[optional]
$locale string[optional]
Результат array
    public function delta($cursor = null, $locale = null)
    {
        // build url
        $url = '1/delta';
        // build parameters
        $parameters = null;
        $parameters['cursor'] = (string) $cursor;
        if ($locale !== null) {
            $parameters['locale'] = (string) $locale;
        }
        // make the call
        return (array) $this->doCall($url, $parameters, 'POST');
    }

Usage Example

Пример #1
0
 /**
  * Tests Dropbox->delta()
  */
 public function testDelta()
 {
     $response = $this->dropbox->delta();
     $this->assertInternalType('array', $response);
     $this->assertArrayHasKey('reset', $response);
     $this->assertInternalType('bool', $response['reset']);
     $this->assertArrayHasKey('cursor', $response);
     $this->assertArrayHasKey('has_more', $response);
     $this->assertInternalType('bool', $response['has_more']);
     $this->assertArrayHasKey('entries', $response);
     foreach ($response['entries'] as $row) {
         $this->assertInternalType('array', $row);
     }
 }