code
stringlengths
31
1.39M
docstring
stringlengths
23
16.8k
func_name
stringlengths
1
126
language
stringclasses
1 value
repo
stringlengths
7
63
path
stringlengths
7
166
url
stringlengths
50
220
license
stringclasses
7 values
public function getExpiryTime() { return (int) $this->expiryTime; }
Get the expiry time @return int
getExpiryTime
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/AccessToken.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/AccessToken.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->account_id = $this->getDataProperty('account_id'); $this->name = (array) $this->getDataProperty('name'); $this->email = $this->getDataProperty('email'); $this->email_verified = $this->getDataProperty('email_verified'); $this->disabled = $this->getDataProperty('disabled'); $this->profile_photo_url = $this->getDataProperty('profile_photo_url'); $this->locale = $this->getDataProperty('locale'); $this->country = $this->getDataProperty('country'); $this->referral_link = $this->getDataProperty('referral_link'); $this->is_paired = $this->getDataProperty('is_paired'); //Account Type $account_type = $this->getDataProperty('account_type'); if (is_array($account_type) && !empty($account_type)) { $this->account_type = $account_type['.tag']; } }
Create a new Account instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function getNameDetails() { return $this->name; }
Get Account User's Name Details @return array
getNameDetails
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function emailIsVerified() { return $this->email_verified ? true : false; }
Whether account email is verified @return boolean
emailIsVerified
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function getProfilePhotoUrl() { return $this->profile_photo_url; }
Get Profile Pic URL @return string
getProfilePhotoUrl
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function isDisabled() { return $this->disabled ? true : false; }
Whether acocunt has been disabled @return boolean
isDisabled
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function getCountry() { return $this->country; }
Get User's two-lettered country code @return string
getCountry
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function getReferralLink() { return $this->referral_link; }
Get user's referral link @return string
getReferralLink
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function isPaired() { return $this->is_paired ? true : false; }
Whether work account is paired @return boolean
isPaired
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/Account.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/Account.php
MIT
public function __construct(array $data) { $processedItems = $this->processItems($data); parent::__construct($processedItems); }
Create a new Metadata Collection @param array $data Collection Data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/AccountList.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/AccountList.php
MIT
protected function processItems(array $items) { $processedItems = []; foreach ($items as $entry) { $processedItems[] = new Account($entry); } return $processedItems; }
Process items and cast them to Account Model @param array $items Unprocessed Items @return array Array of Account models
processItems
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/AccountList.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/AccountList.php
MIT
public function __construct(array $data) { $this->data = $data; }
Create a new Model instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/BaseModel.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/BaseModel.php
MIT
public function getData() { return $this->data; }
Get the Model data @return array
getData
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/BaseModel.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/BaseModel.php
MIT
public function getDataProperty($property) { return isset($this->data[$property]) ? $this->data[$property] : null; }
Get Data Property @param string $property @return mixed
getDataProperty
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/BaseModel.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/BaseModel.php
MIT
public function __get($property) { if (array_key_exists($property, $this->getData())) { return $this->getData()[$property]; } return null; }
Handle calls to undefined properties. Check whether an item with the key, same as the property, is available on the data property. @param string $property @return mixed|null
__get
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/BaseModel.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/BaseModel.php
MIT
public function __set($property, $value) { $this->data[$property] = $value; }
Handle calls to undefined properties. Sets an item with the defined value on the data property. @param string $property @param string $value @return mixed|null
__set
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/BaseModel.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/BaseModel.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->expires = new DateTime($this->getDataProperty('expires')); $this->reference = $this->getDataProperty('copy_reference'); $this->setMetadata(); }
Create a new CopyReference instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/CopyReference.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/CopyReference.php
MIT
public function getExpirationDate() { return $this->expires; }
Get the expiration date of the copy reference @return DateTime
getExpirationDate
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/CopyReference.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/CopyReference.php
MIT
public function getMetadata() { return $this->metadata; }
The metadata for the file/folder @return \Kunnu\Dropbox\Models\FileMetadata|\Kunnu\Dropbox\Models\FolderMetadata
getMetadata
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/CopyReference.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/CopyReference.php
MIT
public function getReference() { return $this->reference; }
Get the copy reference @return string
getReference
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/CopyReference.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/CopyReference.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->name = $this->getDataProperty('name'); $this->path_lower = $this->getDataProperty('path_lower'); $this->sharing_info = $this->getDataProperty('sharing_info'); $this->path_display = $this->getDataProperty('path_display'); }
Create a new DeletedtMetadata instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/DeletedMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/DeletedMetadata.php
MIT
public function getName() { return $this->name; }
Get the 'name' property of the metadata. @return string
getName
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/DeletedMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/DeletedMetadata.php
MIT
public function getPathLower() { return $this->path_lower; }
Get the 'path_lower' property of the metadata. @return string
getPathLower
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/DeletedMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/DeletedMetadata.php
MIT
public function getPathDisplay() { return $this->path_display; }
Get the 'path_display' property of the metadata. @return string
getPathDisplay
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/DeletedMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/DeletedMetadata.php
MIT
public function getSharingInfo() { return $this->sharing_info; }
Get the 'sharing_info' property of the file model. @return \Kunnu\Dropbox\Models\FileSharingInfo
getSharingInfo
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/DeletedMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/DeletedMetadata.php
MIT
public function __construct(array $data, $contents) { parent::__construct($data); $this->contents = $contents; $this->metadata = new FileMetadata($data); }
Create a new File instance @param array $data @param string|DropboxFile $contents
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/File.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/File.php
MIT
public function getMetadata() { return $this->metadata; }
The metadata for the file @return \Kunnu\Dropbox\Models\FileMetadata
getMetadata
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/File.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/File.php
MIT
public function getContents() { if ($this->contents instanceof DropboxFile) { return $this->contents->getContents(); } return $this->contents; }
Get the file contents @return string @throws \Kunnu\Dropbox\Exceptions\DropboxClientException
getContents
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/File.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/File.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->id = $this->getDataProperty('id'); $this->tag = $this->getDataProperty('.tag'); $this->rev = $this->getDataProperty('rev'); $this->name = $this->getDataProperty('name'); $this->size = $this->getDataProperty('size'); $this->path_lower = $this->getDataProperty('path_lower'); $this->path_display = $this->getDataProperty('path_display'); $this->client_modified = $this->getDataProperty('client_modified'); $this->server_modified = $this->getDataProperty('server_modified'); $this->has_explicit_shared_members = $this->getDataProperty('has_explicit_shared_members'); //Make MediaInfo $mediaInfo = $this->getDataProperty('media_info'); if (is_array($mediaInfo)) { $this->media_info = new MediaInfo($mediaInfo); } //Make SharingInfo $sharingInfo = $this->getDataProperty('sharing_info'); if (is_array($sharingInfo)) { $this->sharing_info = new FileSharingInfo($sharingInfo); } }
Create a new FileMetadata instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getId() { return $this->id; }
Get the 'id' property of the file model. @return string
getId
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getTag() { return $this->tag; }
Get the '.tag' property of the file model. @return string
getTag
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getName() { return $this->name; }
Get the 'name' property of the file model. @return string
getName
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getRev() { return $this->rev; }
Get the 'rev' property of the file model. @return string
getRev
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getSize() { return $this->size; }
Get the 'size' property of the file model. @return int
getSize
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getPathLower() { return $this->path_lower; }
Get the 'path_lower' property of the file model. @return string
getPathLower
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getMediaInfo() { return $this->media_info; }
Get the 'media_info' property of the file model. @return \Kunnu\Dropbox\Models\MediaInfo
getMediaInfo
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getSharingInfo() { return $this->sharing_info; }
Get the 'sharing_info' property of the file model. @return \Kunnu\Dropbox\Models\FileSharingInfo
getSharingInfo
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getPathDisplay() { return $this->path_display; }
Get the 'path_display' property of the file model. @return string
getPathDisplay
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getClientModified() { return $this->client_modified; }
Get the 'client_modified' property of the file model. @return string
getClientModified
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function getServerModified() { return $this->server_modified; }
Get the 'server_modified' property of the file model. @return string
getServerModified
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function hasExplicitSharedMembers() { return $this->has_explicit_shared_members; }
Get the 'has_explicit_shared_members' property of the file model. @return bool
hasExplicitSharedMembers
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileMetadata.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->read_only = $this->getDataProperty('read_only'); $this->modified_by = $this->getDataProperty('modified_by'); $this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id'); }
Create a new File Sharing Info instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileSharingInfo.php
MIT
public function isReadOnly() { return $this->read_only; }
True if the file or folder is inside a read-only shared folder. @return bool
isReadOnly
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileSharingInfo.php
MIT
public function getParentSharedFolderId() { return $this->parent_shared_folder_id; }
ID of shared folder that holds this file. @return string
getParentSharedFolderId
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileSharingInfo.php
MIT
public function getModifiedBy() { return $this->modified_by; }
Get the last user who modified the file. @return string
getModifiedBy
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FileSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FileSharingInfo.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->id = $this->getDataProperty('id'); $this->tag = $this->getDataProperty('.tag'); $this->name = $this->getDataProperty('name'); $this->path_lower = $this->getDataProperty('path_lower'); $this->path_display = $this->getDataProperty('path_display'); //Make SharingInfo $sharingInfo = $this->getDataProperty('sharing_info'); if (is_array($sharingInfo)) { $this->sharing_info = new FolderSharingInfo($sharingInfo); } }
Create a new FolderMetadata instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderMetadata.php
MIT
public function getId() { return $this->id; }
Get the 'id' property of the folder model. @return string
getId
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderMetadata.php
MIT
public function getTag() { return $this->tag; }
Get the '.tag' property of the folder model. @return string
getTag
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderMetadata.php
MIT
public function getName() { return $this->name; }
Get the 'name' property of the folder model. @return string
getName
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderMetadata.php
MIT
public function getPathLower() { return $this->path_lower; }
Get the 'path_lower' property of the folder model. @return string
getPathLower
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderMetadata.php
MIT
public function getSharingInfo() { return $this->sharing_info; }
Get the 'sharing_info' property of the folder model. @return \Kunnu\Dropbox\Models\FolderSharingInfo
getSharingInfo
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderMetadata.php
MIT
public function getPathDisplay() { return $this->path_display; }
Get the 'path_display' property of the folder model. @return string
getPathDisplay
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderMetadata.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->read_only = $this->getDataProperty('read_only'); $this->shared_folder_id = $this->getDataProperty('shared_folder_id'); $this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id'); }
Create a new Folder Sharing Info instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderSharingInfo.php
MIT
public function isReadOnly() { return $this->read_only; }
True if the folder or folder is inside a read-only shared folder. @return bool
isReadOnly
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderSharingInfo.php
MIT
public function getParentSharedFolderId() { return $this->parent_shared_folder_id; }
ID of shared folder that holds this folder. @return string
getParentSharedFolderId
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderSharingInfo.php
MIT
public function getSharedFolderId() { return $this->shared_folder_id; }
ID of shared folder. @return string
getSharedFolderId
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/FolderSharingInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/FolderSharingInfo.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->pending = $this->getDataProperty('pending'); $this->setMediaMetadata(); }
Create a new MediaInfo instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MediaInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MediaInfo.php
MIT
public function isPending() { return $this->pending; }
Indicates whether the photo/video is still under processing and is the metadata available yet. @return bool
isPending
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MediaInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MediaInfo.php
MIT
public function getMediaMetadata() { return $this->mediaMetadata; }
The metadata for the photo/video. @return \Kunnu\Dropbox\Models\MediaMetadata
getMediaMetadata
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MediaInfo.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MediaInfo.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->location = (array) $this->getDataProperty('location'); $this->dimensions = (array) $this->getDataProperty('dimensions'); $time_taken = $this->getDataProperty('time_taken'); if ($time_taken) { $this->time_taken = new DateTime($time_taken); } }
Create a new MediaMetadata instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MediaMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MediaMetadata.php
MIT
public function getLocation() { return $this->location; }
Get the location of the Media @return array
getLocation
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MediaMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MediaMetadata.php
MIT
public function getDimensions() { return $this->dimensions; }
Get the dimensions of the Media @return array
getDimensions
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MediaMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MediaMetadata.php
MIT
public function getTimeTaken() { return $this->time_taken; }
Get the Time the Media was taken on @return DateTime
getTimeTaken
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MediaMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MediaMetadata.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->cursor = isset($data[$this->getCollectionCursorKey()]) ? $data[$this->getCollectionCursorKey()] : ''; $this->hasMoreItems = isset($data[$this->getCollectionHasMoreItemsKey()]) && $data[$this->getCollectionHasMoreItemsKey()] ? true : false; $items = isset($data[$this->getCollectionItemsKey()]) ? $data[$this->getCollectionItemsKey()] : []; $this->processItems($items); }
Create a new Metadata Collection @param array $data Collection Data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MetadataCollection.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MetadataCollection.php
MIT
public function getCollectionItemsKey() { return static::COLLECTION_ITEMS_KEY; }
Get the Collection Items Key @return string
getCollectionItemsKey
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MetadataCollection.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MetadataCollection.php
MIT
public function getCollectionHasMoreItemsKey() { return static::COLLECTION_HAS_MORE_ITEMS_KEY; }
Get the Collection has-more-items Key @return string
getCollectionHasMoreItemsKey
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MetadataCollection.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MetadataCollection.php
MIT
public function getCollectionCursorKey() { return static::COLLECTION_CURSOR_KEY; }
Get the Collection Cursor Key @return string
getCollectionCursorKey
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MetadataCollection.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MetadataCollection.php
MIT
public function getItems() { return $this->items; }
Get the Items @return \Kunnu\Dropbox\Models\ModelCollection
getItems
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MetadataCollection.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MetadataCollection.php
MIT
public function hasMoreItems() { return $this->hasMoreItems; }
More items are available @return boolean
hasMoreItems
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MetadataCollection.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MetadataCollection.php
MIT
protected function processItems(array $items) { $processedItems = []; foreach ($items as $entry) { $processedItems[] = ModelFactory::make($entry); } $this->items = new ModelCollection($processedItems); }
Process items and cast them to their respective Models @param array $items Unprocessed Items @return void
processItems
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/MetadataCollection.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/MetadataCollection.php
MIT
public static function make(array $data = array()) { if (static::isFileOrFolder($data)) { $tag = $data['.tag']; //File if (static::isFile($tag)) { return new FileMetadata($data); } //Folder if (static::isFolder($tag)) { return new FolderMetadata($data); } } //Temporary Link if (static::isTemporaryLink($data)) { return new TemporaryLink($data); } //List if (static::isList($data)) { return new MetadataCollection($data); } //Search Results if (static::isSearchResult($data)) { return new SearchResults($data); } //Deleted File/Folder if (static::isDeletedFileOrFolder($data)) { return new DeletedMetadata($data); } //Base Model return new BaseModel($data); }
Make a Model Factory @param array $data Model Data @return \Kunnu\Dropbox\Models\ModelInterface
make
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/ModelFactory.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/ModelFactory.php
MIT
public function __construct(array $data) { parent::__construct($data); $matchType = $this->getDataProperty('match_type'); $this->matchType = isset($matchType['.tag']) ? $matchType['.tag'] : null; $this->setMetadata(); }
Create a new SearchResult instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/SearchResult.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/SearchResult.php
MIT
public function getMatchType() { return $this->matchType; }
Indicates what type of match was found for the result @return bool
getMatchType
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/SearchResult.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/SearchResult.php
MIT
public function getMetadata() { return $this->metadata; }
Get the Search Result Metadata @return \Kunnu\Dropbox\Models\FileMetadata|\Kunnu\Dropbox\Models\FolderMetadata
getMetadata
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/SearchResult.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/SearchResult.php
MIT
protected function processItems(array $items) { $processedItems = []; foreach ($items as $entry) { if (isset($entry['metadata']) && is_array($entry['metadata'])) { $processedItems[] = new SearchResult($entry); } } $this->items = new ModelCollection($processedItems); }
Process items and cast them to their respective Models @param array $items Unprocessed Items @return void
processItems
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/SearchResults.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/SearchResults.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->link = $this->getDataProperty('link'); $this->setMetadata(); }
Create a new TemporaryLink instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/TemporaryLink.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/TemporaryLink.php
MIT
public function getMetadata() { return $this->metadata; }
The metadata for the file @return \Kunnu\Dropbox\Models\FileMetadata
getMetadata
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/TemporaryLink.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/TemporaryLink.php
MIT
public function getLink() { return $this->link; }
Get the temporary link @return string
getLink
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/TemporaryLink.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/TemporaryLink.php
MIT
public function __construct(array $data) { parent::__construct($data); $this->duration = $this->getDataProperty('duration'); }
Create a new VideoMetadata instance @param array $data
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/VideoMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/VideoMetadata.php
MIT
public function getDuration() { return $this->duration; }
Get the duration of the video @return int
getDuration
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Models/VideoMetadata.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Models/VideoMetadata.php
MIT
public function __construct() { if (!function_exists('mcrypt_create_iv')) { throw new DropboxClientException( static::ERROR_MESSAGE . 'The function mcrypt_create_iv() does not exist.' ); } }
Create a new McryptRandomStringGenerator instance @throws \Kunnu\Dropbox\Exceptions\DropboxClientException
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Security/McryptRandomStringGenerator.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Security/McryptRandomStringGenerator.php
MIT
public function generateString($length) { //Create Binary String $binaryString = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); //Unable to create binary string if ($binaryString === false) { throw new DropboxClientException( static::ERROR_MESSAGE . 'mcrypt_create_iv() returned an error.' ); } //Convert binary to hex return $this->binToHex($binaryString, $length); }
Get a randomly generated secure token @param int $length Length of the string to return @throws \Kunnu\Dropbox\Exceptions\DropboxClientException @return string
generateString
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Security/McryptRandomStringGenerator.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Security/McryptRandomStringGenerator.php
MIT
public function __construct() { if (!function_exists('openssl_random_pseudo_bytes')) { throw new DropboxClientException( static::ERROR_MESSAGE . 'The function openssl_random_pseudo_bytes() does not exist.' ); } }
Create a new OpenSslRandomStringGenerator instance @throws \Kunnu\Dropbox\Exceptions\DropboxClientException
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Security/OpenSslRandomStringGenerator.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Security/OpenSslRandomStringGenerator.php
MIT
public function generateString($length) { $cryptoStrong = false; //Create Binary String $binaryString = openssl_random_pseudo_bytes($length, $cryptoStrong); //Unable to create binary string if ($binaryString === false) { throw new DropboxClientException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned an unknown error.'); } //Binary String is not cryptographically strong if ($cryptoStrong !== true) { throw new DropboxClientException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned a pseudo-random string but it was not cryptographically secure and cannot be used.'); } //Convert binary to hex return $this->binToHex($binaryString, $length); }
Get a randomly generated secure token @param int $length Length of the string to return @throws \Kunnu\Dropbox\Exceptions\DropboxClientException @return string
generateString
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Security/OpenSslRandomStringGenerator.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Security/OpenSslRandomStringGenerator.php
MIT
public static function makeRandomStringGenerator($generator = null) { //No generator provided if (is_null($generator)) { //Generate default random string generator return static::defaultRandomStringGenerator(); } //RandomStringGeneratorInterface if ($generator instanceof RandomStringGeneratorInterface) { return $generator; } // Mcrypt if ('mcrypt' === $generator) { return new McryptRandomStringGenerator(); } //OpenSSL if ('openssl' === $generator) { return new OpenSslRandomStringGenerator(); } //Invalid Argument throw new InvalidArgumentException('The random string generator must be set to "mcrypt", "openssl" or be an instance of Kunnu\Dropbox\Security\RandomStringGeneratorInterface'); }
Make a Random String Generator @param null|string|\Kunnu\Dropbox\Security\RandomStringGeneratorInterface $generator @throws \Kunnu\Dropbox\Exceptions\DropboxClientException @return \Kunnu\Dropbox\Security\RandomStringGeneratorInterface
makeRandomStringGenerator
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Security/RandomStringGeneratorFactory.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Security/RandomStringGeneratorFactory.php
MIT
protected static function defaultRandomStringGenerator() { //Mcrypt if (function_exists('mcrypt_create_iv') && version_compare(PHP_VERSION, '7.1', '<')) { return new McryptRandomStringGenerator(); } //OpenSSL if (function_exists('openssl_random_pseudo_bytes')) { return new OpenSslRandomStringGenerator(); } //Unable to create a random string generator throw new DropboxClientException('Unable to detect a cryptographically secure pseudo-random string generator.'); }
Get Default Random String Generator @throws \Kunnu\Dropbox\Exceptions\DropboxClientException @return RandomStringGeneratorInterface
defaultRandomStringGenerator
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Security/RandomStringGeneratorFactory.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Security/RandomStringGeneratorFactory.php
MIT
public function binToHex($binaryData, $length) { return substr(bin2hex($binaryData), 0, $length); }
Converts binary data to hexadecimal of given length @param string $binaryData The binary data to convert to hex. @param int $length The length of the string to return. @throws \RuntimeException Throws an exception when multibyte support is not enabled @return string
binToHex
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Security/RandomStringGeneratorTrait.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Security/RandomStringGeneratorTrait.php
MIT
public static function makePersistentDataStore($store = null) { if (is_null($store) || $store === 'session') { return new SessionPersistentDataStore(); } if ($store instanceof PersistentDataStoreInterface) { return $store; } throw new InvalidArgumentException('The persistent data store must be set to null, "session" or be an instance of use \Kunnu\Dropbox\Store\PersistentDataStoreInterface'); }
Make Persistent Data Store @param null|string|\Kunnu\Dropbox\Store\PersistentDataStoreInterface $store @throws InvalidArgumentException @return \Kunnu\Dropbox\Store\PersistentDataStoreInterface
makePersistentDataStore
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Store/PersistentDataStoreFactory.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Store/PersistentDataStoreFactory.php
MIT
public function __construct($prefix = "DBAPI_") { $this->prefix = $prefix; }
Create a new SessionPersistentDataStore instance @param string $prefix Session Variable Prefix
__construct
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Store/SessionPersistentDataStore.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Store/SessionPersistentDataStore.php
MIT
public function get($key) { if (isset($_SESSION[$this->prefix . $key])) { return $_SESSION[$this->prefix . $key]; } return null; }
Get a value from the store @param string $key Data Key @return string|null
get
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Store/SessionPersistentDataStore.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Store/SessionPersistentDataStore.php
MIT
public function set($key, $value) { $_SESSION[$this->prefix . $key] = $value; }
Set a value in the store @param string $key Data Key @param string $value Data Value @return void
set
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Store/SessionPersistentDataStore.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Store/SessionPersistentDataStore.php
MIT
public function clear($key) { if (isset($_SESSION[$this->prefix . $key])) { unset($_SESSION[$this->prefix . $key]); } }
Clear the key from the store @param $key Data Key @return void
clear
php
kunalvarma05/dropbox-php-sdk
src/Dropbox/Store/SessionPersistentDataStore.php
https://github.com/kunalvarma05/dropbox-php-sdk/blob/master/src/Dropbox/Store/SessionPersistentDataStore.php
MIT
function request($host, $path) { $unsigned_url = "https://" . $host . $path; // Token object built using the OAuth library $token = new OAuthToken($GLOBALS['TOKEN'], $GLOBALS['TOKEN_SECRET']); // Consumer object built using the OAuth library $consumer = new OAuthConsumer($GLOBALS['CONSUMER_KEY'], $GLOBALS['CONSUMER_SECRET']); // Yelp uses HMAC SHA1 encoding $signature_method = new OAuthSignatureMethod_HMAC_SHA1(); $oauthrequest = OAuthRequest::from_consumer_and_token( $consumer, $token, 'GET', $unsigned_url ); // Sign the request $oauthrequest->sign_request($signature_method, $consumer, $token); // Get the signed URL $signed_url = $oauthrequest->to_url(); // Send Yelp API Call try { $ch = curl_init($signed_url); if (FALSE === $ch) throw new Exception('Failed to initialize'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 0); $data = curl_exec($ch); if (FALSE === $data) throw new Exception(curl_error($ch), curl_errno($ch)); $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (200 != $http_status) throw new Exception($data, $http_status); curl_close($ch); } catch(Exception $e) { trigger_error(sprintf( 'Curl failed with error #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR); } return $data; }
Makes a request to the Yelp API and returns the response @param $host The domain host of the API @param $path The path of the APi after the domain @return The JSON response from the request
request
php
Yelp/yelp-api
v2/php/sample.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/sample.php
MIT
function search($term, $location) { $url_params = array(); $url_params['term'] = $term ?: $GLOBALS['DEFAULT_TERM']; $url_params['location'] = $location?: $GLOBALS['DEFAULT_LOCATION']; $url_params['limit'] = $GLOBALS['SEARCH_LIMIT']; $search_path = $GLOBALS['SEARCH_PATH'] . "?" . http_build_query($url_params); return request($GLOBALS['API_HOST'], $search_path); }
Query the Search API by a search term and location @param $term The search term passed to the API @param $location The search location passed to the API @return The JSON response from the request
search
php
Yelp/yelp-api
v2/php/sample.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/sample.php
MIT
function get_business($business_id) { $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id); return request($GLOBALS['API_HOST'], $business_path); }
Query the Business API by business_id @param $business_id The ID of the business to query @return The JSON response from the request
get_business
php
Yelp/yelp-api
v2/php/sample.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/sample.php
MIT
function query_api($term, $location) { $response = json_decode(search($term, $location)); $business_id = $response->businesses[0]->id; print sprintf( "%d businesses found, querying business info for the top result \"%s\"\n\n", count($response->businesses), $business_id ); $response = get_business($business_id); print sprintf("Result for business \"%s\" found:\n", $business_id); print "$response\n"; }
Queries the API by the input values from the user @param $term The search term to query @param $location The location of the business to query
query_api
php
Yelp/yelp-api
v2/php/sample.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/sample.php
MIT
function __construct($key, $secret) { $this->key = $key; $this->secret = $secret; }
key = the token secret = the token secret
__construct
php
Yelp/yelp-api
v2/php/lib/OAuth.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/lib/OAuth.php
MIT
function to_string() { return "oauth_token=" . OAuthUtil::urlencode_rfc3986($this->key) . "&oauth_token_secret=" . OAuthUtil::urlencode_rfc3986($this->secret); }
generates the basic string serialization of a token that a server would respond to request_token and access_token calls with
to_string
php
Yelp/yelp-api
v2/php/lib/OAuth.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/lib/OAuth.php
MIT
public function check_signature($request, $consumer, $token, $signature) { $built = $this->build_signature($request, $consumer, $token); // Check for zero length, although unlikely here if (strlen($built) == 0 || strlen($signature) == 0) { return false; } if (strlen($built) != strlen($signature)) { return false; } // Avoid a timing leak with a (hopefully) time insensitive compare $result = 0; for ($i = 0; $i < strlen($signature); $i++) { $result |= ord($built{$i}) ^ ord($signature{$i}); } return $result == 0; }
Verifies that a given signature is correct @param OAuthRequest $request @param OAuthConsumer $consumer @param OAuthToken $token @param string $signature @return bool
check_signature
php
Yelp/yelp-api
v2/php/lib/OAuth.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/lib/OAuth.php
MIT
public function build_signature($request, $consumer, $token) { $key_parts = array( $consumer->secret, ($token) ? $token->secret : "" ); $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); $key = implode('&', $key_parts); $request->base_string = $key; return $key; }
oauth_signature is set to the concatenated encoded values of the Consumer Secret and Token Secret, separated by a '&' character (ASCII code 38), even if either secret is empty. The result MUST be encoded again. - Chapter 9.4.1 ("Generating Signatures") Please note that the second encoding MUST NOT happen in the SignatureMethod, as OAuthRequest handles this!
build_signature
php
Yelp/yelp-api
v2/php/lib/OAuth.php
https://github.com/Yelp/yelp-api/blob/master/v2/php/lib/OAuth.php
MIT