本文整理汇总了PHP中WindowsAzure\Common\Internal\Validate::isArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Validate::isArray方法的具体用法?PHP Validate::isArray怎么用?PHP Validate::isArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowsAzure\Common\Internal\Validate
的用法示例。
在下文中一共展示了Validate::isArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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']);
}
}
示例2: 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']);
}
}
示例3: 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);
}
}
}
示例4: _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));
}
}
示例5: create
/**
* Creates BatchError object.
*
* @param WindowsAzure\Common\ServiceException $error The error object.
* @param array $headers The response headers.
*
* @return \WindowsAzure\Table\Models\BatchError
*/
public static function create($error, $headers)
{
Validate::isTrue($error instanceof ServiceException, Resources::INVALID_EXC_OBJ_MSG);
Validate::isArray($headers, 'headers');
$result = new BatchError();
$clean = array_change_key_case($headers);
$result->setError($error);
$contentId = Utilities::tryGetValue($clean, Resources::CONTENT_ID);
$result->setContentId(is_null($contentId) ? null : intval($contentId));
return $result;
}
示例6: __construct
/**
* Constructor
*
* @param string $name The role name.
* @param array $instances The role instances.
*/
public function __construct($name, $instances)
{
Validate::isArray($instances, 'instances');
$this->_name = $name;
$this->_instances = $instances;
}
示例7: setValueArrayDateTime
/**
* 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());
}
}
示例8: addOptionalHeader
/**
* Adds optional header.
*
* Doesn't add the value if it satisfies empty().
*
* @param array &$headers The HTTP header parameters.
* @param string $key The HTTP header name.
* @param string $value The HTTP header value.
*
* @return none
*/
protected function addOptionalHeader(&$headers, $key, $value)
{
Validate::isArray($headers, 'headers');
Validate::isString($key, 'key');
Validate::isString($value, 'value');
if (!is_null($value) && Resources::EMPTY_STRING !== $value) {
$headers[$key] = $value;
}
}
示例9: writeArrayItem
/**
* Processes author node.
*
* @param array $xmlWriter The XML writer.
* @param array $itemArray An array of item to write.
* @param array $elementName The name of the element.
*
* @return array
*/
protected function writeArrayItem($xmlWriter, $itemArray, $elementName)
{
Validate::notNull($xmlWriter, 'xmlWriter');
Validate::isArray($itemArray, 'itemArray');
Validate::isString($elementName, 'elementName');
foreach ($itemArray as $itemInstance) {
$xmlWriter->startElementNS('atom', $elementName, Resources::ATOM_NAMESPACE);
$itemInstance->writeInnerXml($xmlWriter);
$xmlWriter->endElement();
}
}
示例10: fromArray
/**
* Fill ChannelInput from array.
*
* @param array $options Array containing values for object properties
*/
public function fromArray($options)
{
if (!empty($options['KeyFrameInterval'])) {
Validate::isString($options['KeyFrameInterval'], 'options[KeyFrameInterval]');
$this->_keyFrameInterval = $options['KeyFrameInterval'];
}
if (isset($options['StreamingProtocol'])) {
Validate::isString($options['StreamingProtocol'], 'options[StreamingProtocol]');
$this->_streamingProtocol = $options['StreamingProtocol'];
}
if (isset($options['AccessControl'])) {
Validate::isArray($options['AccessControl'], 'options[AccessControl]');
$this->_accessControl = ChannelInputAccessControl::createFromOptions($options['AccessControl']);
}
if (!empty($options['Endpoints'])) {
Validate::isArray($options['Endpoints'], 'options[Endpoints]');
foreach ($options['Endpoints'] as $endpoint) {
$this->_endpoints[] = ChannelEndpoint::createFromOptions($endpoint);
}
}
}
示例11: testIsArrayWithNonArray
/**
* @covers WindowsAzure\Common\Internal\Validate::isArray
*/
public function testIsArrayWithNonArray()
{
$this->setExpectedException(get_class(new InvalidArgumentTypeException('')));
Validate::isArray(123, 'array');
}
示例12: setLink
/**
* Sets the link of the feed.
*
* @param array $link The link of the feed.
*
* @return none
*/
public function setLink($link)
{
Validate::isArray($link, 'link');
$this->link = $link;
}
示例13: validateMetadata
/**
* Validates the provided metadata array.
*
* @param mix $metadata The metadata array.
*
* @return none
*/
public function validateMetadata($metadata)
{
if (!is_null($metadata)) {
Validate::isArray($metadata, 'metadata');
} else {
$metadata = array();
}
foreach ($metadata as $key => $value) {
Validate::isString($key, 'metadata key');
Validate::isString($value, 'metadata value');
}
}
示例14: fromArray
/**
* Fill Channel 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'];
}
if (isset($options['Created'])) {
Validate::isDateString($options['Created'], 'options[Created]');
$this->_created = new \DateTime($options['Created']);
}
if (isset($options['Description'])) {
Validate::isString($options['Description'], 'options[Description]');
$this->_description = $options['Description'];
}
if (isset($options['LastModified'])) {
Validate::isDateString($options['LastModified'], 'options[LastModified]');
$this->_lastModified = new \DateTime($options['LastModified']);
}
if (isset($options['State'])) {
Validate::isString($options['State'], 'options[State]');
$this->_state = $options['State'];
}
if (!empty($options['Input'])) {
Validate::isArray($options['Input'], 'options[Input]');
$this->_input = ChannelInput::createFromOptions($options['Input']);
}
if (!empty($options['Output'])) {
Validate::isArray($options['Output'], 'options[Output]');
$this->_output = ChannelOutput::createFromOptions($options['Output']);
}
if (!empty($options['Preview'])) {
Validate::isArray($options['Preview'], 'options[Preview]');
$this->_preview = ChannelPreview::createFromOptions($options['Preview']);
}
if (!empty($options['CrossSiteAccessPolicies'])) {
Validate::isArray($options['CrossSiteAccessPolicies'], 'options[CrossSiteAccessPolicies]');
$this->_crossSiteAccessPolicies = CrossSiteAccessPolicies::createFromOptions($options['CrossSiteAccessPolicies']);
}
if (isset($options['EncodingType'])) {
Validate::isString($options['EncodingType'], 'options[EncodingType]');
$this->_encodingType = $options['EncodingType'];
}
if (!empty($options['Encoding'])) {
Validate::isArray($options['Encoding'], 'options[Encoding]');
$this->_encoding = ChannelEncoding::createFromOptions($options['Encoding']);
}
if (!empty($options['Slate'])) {
Validate::isArray($options['Slate'], 'options[Slate]');
$this->_slate = ChannelSlate::createFromOptions($options['Slate']);
}
}
示例15: fromArray
/**
* Fill ContentKeyAuthorizationPolicyOption from array
*
* @param array $options Array containing values for object properties
*
* @return void
*/
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'];
}
if (isset($options['KeyDeliveryType'])) {
Validate::isInteger($options['KeyDeliveryType'], 'options[KeyDeliveryType]');
$this->_keyDeliveryType = $options['KeyDeliveryType'];
}
if (isset($options['KeyDeliveryConfiguration'])) {
Validate::isString($options['KeyDeliveryConfiguration'], 'options[KeyDeliveryConfiguration]');
$this->_keyDeliveryConfiguration = $options['KeyDeliveryConfiguration'];
}
if (!empty($options['Restrictions'])) {
Validate::isArray($options['Restrictions'], 'options[Restrictions]');
foreach ($options['Restrictions'] as $restriction) {
$this->_restrictions[] = ContentKeyAuthorizationPolicyRestriction::createFromOptions($restriction);
}
}
}