本文整理汇总了PHP中Tracking::setWhen方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracking::setWhen方法的具体用法?PHP Tracking::setWhen怎么用?PHP Tracking::setWhen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracking
的用法示例。
在下文中一共展示了Tracking::setWhen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItemInfo
/**
* Get Item Info
*
* @param itemId - required -
* Item id
* @return An Item object with details like itemId, expiration date, file details etc.
* or the error code and message returned by the server.
* */
public function getItemInfo($itemId)
{
$parameters = array();
$urld = 'dpi/v1/item/' . $itemId;
$this->response = $this->_restTransportInstance->sendRequest($urld, $parameters, 'GET', $this->_authToken);
$responseBody = simplexml_load_string($this->response);
$returnObject = new Item();
if ($responseBody === false) {
$errorCode = 'N/A';
$errorMessage = 'The server has encountered an error, please try again.';
$errorObject = new ErrorStatus($errorCode, $errorMessage);
$returnObject->setErrorStatus($errorObject);
} else {
if (empty($responseBody->errorStatus)) {
$create = (string) $responseBody->create;
$returnObject->setCreate($create);
$expiration = (string) $responseBody->expiration;
$returnObject->setExpiration($expiration);
$id = (string) $responseBody->id;
$returnObject->setId($id);
$subject = (string) $responseBody->subject;
$returnObject->setSubject($subject);
$message = (string) $responseBody->message;
$returnObject->setMessage($message);
$recipients = (string) $responseBody->recipients;
$returnObject->setRecipients(explode(",", $recipients));
$theFiles = array();
$filesTag = $responseBody->file;
if (!empty($filesTag)) {
foreach ($responseBody->file as $currentFile) {
if ($currentFile->count() > 0) {
$file = new File();
$file->setDownloadUrl((string) $currentFile->downloadUrl);
$file->setDownloads((string) $currentFile->downloads);
$file->setId((string) $currentFile->id);
$file->setName((string) $currentFile->name);
$file->setPasswordProtect((string) $currentFile->passwordProtect);
$file->setReturnReceipt((string) $currentFile->returnReceipt);
$file->setSize((string) $currentFile->size);
$file->setVerifyIdentity((string) $currentFile->verifyIdentity);
$tracking = array();
$trackTag = $currentFile->tracking;
if (!empty($trackTag)) {
foreach ($currentFile->tracking as $currentTrack) {
if ($currentTrack->count() > 0) {
$track = new Tracking();
$track->setEmail((string) $currentTrack->email);
$track->setWhen((string) $currentTrack->when);
array_push($tracking, $track);
}
}
$file->setTracking($tracking);
}
array_push($theFiles, $file);
}
}
$returnObject->setFiles($theFiles);
}
} else {
$errorCode = (string) $responseBody->errorStatus->code;
$errorMessage = (string) $responseBody->errorStatus->message;
$errorObject = new ErrorStatus($errorCode, $errorMessage);
$returnObject->setErrorStatus($errorObject);
}
}
return $returnObject;
}