本文整理汇总了PHP中WindowsAzure\Common\Internal\Validate::isString方法的典型用法代码示例。如果您正苦于以下问题:PHP Validate::isString方法的具体用法?PHP Validate::isString怎么用?PHP Validate::isString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowsAzure\Common\Internal\Validate
的用法示例。
在下文中一共展示了Validate::isString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: _validateProperties
/**
* Validates if properties is valid or not.
*
* @param mix $properties The properties array.
*
* @return none
*/
private function _validateProperties($properties)
{
Validate::isArray($properties, 'entity properties');
foreach ($properties as $key => $value) {
Validate::isString($key, 'key');
Validate::isTrue($value instanceof Property, Resources::INVALID_PROP_MSG);
Validate::isTrue(EdmType::validateEdmValue($value->getEdmType(), $value->getValue(), $condition), sprintf(Resources::INVALID_PROP_VAL_MSG, $key, $condition));
}
}
示例3: 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;
}
}
示例4: fromArray
/**
* Fill storage account from array
*
* @param array $options Array containing values for object properties
*
* @return none
*/
public function fromArray($options)
{
if (isset($options['Name'])) {
Validate::isString($options['Name'], 'options[Name]');
$this->_name = $options['Name'];
}
if (isset($options['IsDefault'])) {
Validate::isBoolean($options['IsDefault'], 'options[IsDefault]');
$this->_isDefault = $options['IsDefault'];
}
}
示例5: 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'];
}
}
示例6: 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'];
}
}
示例7: 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'];
}
}
示例8: fromArray
/**
* Fill CrossSiteAccessPolicies from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (isset($options['ClientAccessPolicy'])) {
Validate::isString($options['ClientAccessPolicy'], 'options[ClientAccessPolicy]');
$this->_clientAccessPolicy = $options['ClientAccessPolicy'];
}
if (isset($options['CrossDomainPolicy'])) {
Validate::isString($options['CrossDomainPolicy'], 'options[CrossDomainPolicy]');
$this->_crossDomainPolicy = $options['CrossDomainPolicy'];
}
}
示例9: 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'];
}
}
示例10: __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);
}
示例11: __construct
/**
* Constructor.
*
* @param string $accountName account name.
* @param string $accountKey account
* secondary key.
* @param string $grantType grant type
* for OAuth request.
* @param string $scope scope for
* OAurh request.
* @param WindowsAzure\Common\Internal\OAuthRestProxy $oauthService account
* primary or secondary key.
*/
public function __construct($accountName, $accountKey, $grantType, $scope, $oauthService)
{
Validate::isString($accountName, 'accountName');
Validate::isString($accountKey, 'accountKey');
Validate::isString($grantType, 'grantType');
Validate::isString($scope, 'scope');
Validate::notNull($oauthService, 'oauthService');
$this->accountName = $accountName;
$this->accountKey = $accountKey;
$this->grantType = $grantType;
$this->scope = $scope;
$this->oauthService = $oauthService;
}
示例12: parseXml
/**
* Creates an ATOM CONTENT instance with specified xml string.
*
* @param string $xmlString an XML based string of ATOM CONTENT.
*
* @return none
*/
public function parseXml($xmlString)
{
Validate::notNull($xmlString, 'xmlString');
Validate::isString($xmlString, 'xmlString');
$contentXml = simplexml_load_string($xmlString);
Validate::notNull($contentXml, 'contentXml');
$attributes = $contentXml->attributes();
if (!empty($attributes['type'])) {
$this->content = (string) $attributes['type'];
}
$text = '';
foreach ($contentXml->children() as $child) {
$text .= $child->asXML();
}
$this->text = $text;
}
示例13: setMaxResults
/**
* Sets max results.
*
* @param string $maxResults value.
*
* @return none.
*/
public function setMaxResults($maxResults)
{
Validate::isString($maxResults, 'maxResults');
$this->_maxResults = $maxResults;
}
示例14: deleteQueue
/**
* Deletes a queue.
*
* @link http://msdn.microsoft.com/en-us/library/windowsazure/hh780747
*
* @param string $queuePath The path of the queue.
*
* @return none
*/
public function deleteQueue($queuePath)
{
Validate::isString($queuePath, 'queuePath');
Validate::notNullOrEmpty($queuePath, 'queuePath');
$httpCallContext = new HttpCallContext();
$httpCallContext->setMethod(Resources::HTTP_DELETE);
$httpCallContext->addStatusCode(Resources::STATUS_OK);
$httpCallContext->setPath($queuePath);
$this->sendContext($httpCallContext);
}
示例15: __construct
/**
* Creates new media services settings instance.
*
* @param string $accountName The user provided account name.
* @param string $accessKey The user provided primary access key
* @param string $endpointUri The service management endpoint uri.
* @param string $oauthEndpointUri The OAuth service endpoint uri.
*/
public function __construct($accountName, $accessKey, $endpointUri = null, $oauthEndpointUri = null)
{
Validate::notNullOrEmpty($accountName, 'accountName');
Validate::notNullOrEmpty($accessKey, 'accountKey');
Validate::isString($accountName, 'accountName');
Validate::isString($accessKey, 'accountKey');
if ($endpointUri != null) {
Validate::isValidUri($endpointUri);
} else {
$endpointUri = Resources::MEDIA_SERVICES_URL;
}
if ($oauthEndpointUri != null) {
Validate::isValidUri($oauthEndpointUri);
} else {
$oauthEndpointUri = Resources::MEDIA_SERVICES_OAUTH_URL;
}
$this->_accountName = $accountName;
$this->_accessKey = $accessKey;
$this->_endpointUri = $endpointUri;
$this->_oauthEndpointUri = $oauthEndpointUri;
}