* @copyright 2012 Microsoft Corporation * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @link https://github.com/windowsazure/azure-sdk-for-php */ namespace WindowsAzure\Blob\Models; use WindowsAzure\Common\Internal\Resources; use WindowsAzure\Common\Internal\Utilities; /** * The result of calling copyBlob API. * * @category Microsoft * @package WindowsAzure\Blob\Models * @author Azure PHP SDK * @copyright 2012 Microsoft Corporation * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * @version Release: 0.4.1_2015-03 * @link https://github.com/windowsazure/azure-sdk-for-php */ class CopyBlobResult { /** * @var string */ private $_etag; /** * @var \DateTime */ private $_lastModified; /** * Creates CopyBlobResult object from the response of the copy blob request. * * @param array $headers The HTTP response headers in array representation. * * @return CopyBlobResult */ public static function create($headers) { $result = new CopyBlobResult(); $result->setETag(Utilities::tryGetValueInsensitive( Resources::ETAG, $headers)); if (Utilities::arrayKeyExistsInsensitive(Resources::LAST_MODIFIED, $headers)) { $lastModified = Utilities::tryGetValueInsensitive( Resources::LAST_MODIFIED, $headers); $result->setLastModified(Utilities::rfc1123ToDateTime($lastModified)); } return $result; } /** * Gets ETag. * * @return string */ public function getETag() { return $this->_etag; } /** * Sets ETag. * * @param string $etag value. * * @return none */ public function setETag($etag) { $this->_etag = $etag; } /** * Gets blob lastModified. * * @return \DateTime */ public function getLastModified() { return $this->_lastModified; } /** * Sets blob lastModified. * * @param \DateTime $lastModified value. * * @return none */ public function setLastModified($lastModified) { $this->_lastModified = $lastModified; } }