/** * Constructor * * @param string $incarnation The incarnation. * @param string $expectedState The expected state. * @param string $environmentPath The environment path. * @param \DateTime $deadline The deadline. * @param string $currentStateEndpoint The current state endpoint. */ public function __construct($incarnation, $expectedState, $environmentPath, $deadline, $currentStateEndpoint) { Validate::isDate($deadline); $this->_incarnation = $incarnation; $this->_expectedState = $expectedState; $this->_environmentPath = $environmentPath; $this->_deadline = $deadline; $this->_currentStateEndpoint = $currentStateEndpoint; }
/** * Sets blob lastModified. * * @param \DateTime $lastModified value. * * @return none. */ public function setLastModified($lastModified) { Validate::isDate($lastModified); $this->_lastModified = $lastModified; }
/** * @covers WindowsAzure\Common\Internal\Validate::isDate */ public function testIsDateWithNonDate() { $this->setExpectedException(get_class(new InvalidArgumentTypeException('DateTime'))); Validate::isDate('not date'); }
/** * Returns an access condition such that an operation will be performed only if * the resource has not been modified since the specified time. * <p> * Setting this access condition modifies the request to include the HTTP * <i>If-Unmodified-Since</i> conditional header. If this access condition is * set, the operation is performed only if the resource has not been modified * since the specified time. * <p> * For more information, see * <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642&clcid=0x409'> * Specifying Conditional Headers for Blob Service Operations</a>. * * @param \DateTime $lastModified date that represents the last-modified * time to check for the resource. * * @return \WindowsAzure\Blob\Models\AccessCondition */ public static function ifNotModifiedSince($lastModified) { Validate::isDate($lastModified); return new AccessCondition(Resources::IF_UNMODIFIED_SINCE, $lastModified); }
/** * Sets expiry. * * @param \DateTime $expiry value. * * @return none. */ public function setExpiry($expiry) { Validate::isDate($expiry); $this->_expiry = $expiry; }
/** * Sets a DateTime value in an array. * * @param array &$valueArray The array of a set of values. * @param string $key The key of the key value pair. * @param \DateTime $value The value of the key value pair. * * @return none */ public function setValueArrayDateTime(&$valueArray, $key, $value) { Validate::isArray($valueArray, 'valueArray'); Validate::isString($key, 'key'); if (!empty($value)) { Validate::isDate($value, 'value'); $valueArray[$key] = gmdate(Resources::AZURE_DATE_FORMAT, $value->getTimestamp()); } }
/** * Adds new signed modifier * * @param string $id a unique id for this modifier * @param \DateTime $start The time at which the Shared Access Signature * becomes valid. If omitted, start time for this call is assumed to be * the time when the Blob service receives the request. * @param \DateTime $expiry The time at which the Shared Access Signature * becomes invalid. This field may be omitted if it has been specified as * part of a container-level access policy. * @param string $permission The permissions associated with the Shared * Access Signature. The user is restricted to operations allowed by the * permissions. Valid permissions values are read (r), write (w), delete (d) and * list (l). * * @return none. * * @see http://msdn.microsoft.com/en-us/library/windowsazure/hh508996.aspx */ public function addSignedIdentifier($id, $start, $expiry, $permission) { Validate::isString($id, 'id'); Validate::isDate($start); Validate::isDate($expiry); Validate::isString($permission, 'permission'); $accessPolicy = new AccessPolicy(); $accessPolicy->setStart($start); $accessPolicy->setExpiry($expiry); $accessPolicy->setPermission($permission); $signedIdentifier = new SignedIdentifier(); $signedIdentifier->setId($id); $signedIdentifier->setAccessPolicy($accessPolicy); $this->_signedIdentifiers[] = $signedIdentifier; }
/** * Sets timeNextVisible field. * * @param \DateTime $timeNextVisible A UTC date/time value that represents when * the message will be visible on the queue. * * @return none. */ public function setTimeNextVisible($timeNextVisible) { Validate::isDate($timeNextVisible); $this->_timeNextVisible = $timeNextVisible; }