本文整理汇总了PHP中WindowsAzure\Common\Internal\Validate类的典型用法代码示例。如果您正苦于以下问题:PHP Validate类的具体用法?PHP Validate怎么用?PHP Validate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Validate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromArray
/**
* Fill VideoStream from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['Index'])) {
Validate::isInteger($options['Index'], 'options[Index]');
$this->_index = (int) $options['Index'];
}
}
示例2: fromArray
/**
* Fill ChannelOutput from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['Hls'])) {
Validate::isArray($options['Hls'], 'options[Hls]');
$this->_hls = ChannelOutputHls::createFromOptions($options['Hls']);
}
}
示例3: fromArray
/**
* Fill ChannelOutputHls from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['FragmentsPerSegment'])) {
Validate::isInteger($options['FragmentsPerSegment'], 'options[FragmentsPerSegment]');
$this->_fragmentsPerSegment = (int) $options['FragmentsPerSegment'];
}
}
示例4: fromArray
/**
* Fill ChannelPreviewAccessControl from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (!empty($options['IP'])) {
Validate::isArray($options['IP'], 'options[IP]');
$this->_ip = IPAccessControl::createFromOptions($options['IP']);
}
}
示例5: handleRequest
/**
* Adds WRAP authentication header to the request headers.
*
* @param HttpClient $request HTTP channel object.
*
* @return \HTTP_Request2
*/
public function handleRequest($request)
{
Validate::notNull($request, 'request');
$wrapAccessToken = $this->_wrapTokenManager->getAccessToken($request->getUrl());
$authorization = sprintf(Resources::WRAP_AUTHORIZATION, $wrapAccessToken);
$request->setHeader(Resources::AUTHENTICATION, $authorization);
return $request;
}
示例6: create
/**
* Creates new object based on the builder type in the $config.
*
* @param WindowsAzure\Common\Configuration $config The config
* object.
* @param WindowsAzure\Common\Internal\IServicesBuilder $builder The builder
* object.
*
* @return WindowsAzure\Blob\BlobRestProxy
*/
public static function create($config, $builder = null)
{
Validate::isTrue($config instanceof Configuration, Resources::INVALID_CONFIG_MSG);
if (!is_null($builder)) {
Validate::isTrue($builder instanceof IServiceBuilder, Resources::INVALID_BUILDER_MSG);
}
return $config->create(Resources::BLOB_TYPE_NAME, $builder);
}
示例7: fromArray
/**
* Fill IPRange from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['Allow'])) {
Validate::isArray($options['Allow'], 'options[Allow]');
foreach ($options['Allow'] as $allow) {
$this->_allow[] = IPRange::createFromOptions($allow);
}
}
}
示例8: addEntry
/**
* Adds new entry to the block list entries.
*
* @param string $blockId The block id.
* @param string $type The entry type, you can use BlobBlockType.
*
* @return none
*/
public function addEntry($blockId, $type)
{
Validate::isString($blockId, 'blockId');
Validate::isTrue(BlobBlockType::isValid($type), sprintf(Resources::INVALID_BTE_MSG, get_class(new BlobBlockType())));
$block = new Block();
$block->setBlockId($blockId);
$block->setType($type);
$this->_entries[] = $block;
}
示例9: __construct
/**
* 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;
}
示例10: unserialize
/**
* Unserializes given serialized string to array.
*
* @param string $serialized The serialized object in string representation.
*
* @return array
*/
public function unserialize($serialized)
{
Validate::isString($serialized, 'serialized');
$json = json_decode($serialized);
if ($json && !is_array($json)) {
return get_object_vars($json);
} else {
return $json;
}
}
示例11: __construct
/**
* Creates an RuleInfo with specified parameters.
*
* @param string $title The title of the rule.
* @param RuleDescription $ruleDescription The description of the rule.
*/
public function __construct($title = Resources::EMPTY_STRING, $ruleDescription = null)
{
Validate::isString($title, 'title');
if (is_null($ruleDescription)) {
$ruleDescription = new RuleDescription();
}
$this->_ruleDescription = $ruleDescription;
$this->_entry = new Entry();
$this->_entry->setTitle($title);
$this->_entry->setAttribute(Resources::XMLNS, Resources::SERVICE_BUS_NAMESPACE);
}
示例12: fromArray
/**
* Fill ChannelEndpoint from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['Protocol'])) {
Validate::isString($options['Protocol'], 'options[Protocol]');
$this->_protocol = $options['Protocol'];
}
if (isset($options['Url'])) {
Validate::isString($options['Url'], 'options[Url]');
$this->_url = $options['Url'];
}
}
示例13: fromArray
/**
* Fill ContentKeyAuthorizationPolicy from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['Id'])) {
Validate::isString($options['Id'], 'options[Id]');
$this->_id = $options['Id'];
}
if (isset($options['Name'])) {
Validate::isString($options['Name'], 'options[Name]');
$this->_name = $options['Name'];
}
}
示例14: fromArray
/**
* Fill ChannelSlate from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['InsertSlateOnAdMarker'])) {
Validate::isBoolean($options['InsertSlateOnAdMarker'], 'options[InsertSlateOnAdMarker]');
$this->_insertSlateOnAdMarker = (bool) $options['InsertSlateOnAdMarker'];
}
if (isset($options['DefaultSlateAssetId'])) {
Validate::isString($options['DefaultSlateAssetId'], 'options[DefaultSlateAssetIdUrl]');
$this->_defaultSlateAssetId = $options['DefaultSlateAssetId'];
}
}
示例15: fromArray
/**
* Fill error detail from array
*
* @param array $options Array containing values for object properties
*
* @return none
*/
public function fromArray($options)
{
if (isset($options['Code'])) {
Validate::isInteger($options['Code'], 'options[Code]');
$this->_code = $options['Code'];
}
if (isset($options['Message'])) {
Validate::isString($options['Message'], 'options[Message]');
$this->_message = $options['Message'];
}
}