当前位置: 首页>>代码示例>>PHP>>正文


PHP Utilities::toBoolean方法代码示例

本文整理汇总了PHP中WindowsAzure\Common\Internal\Utilities::toBoolean方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::toBoolean方法的具体用法?PHP Utilities::toBoolean怎么用?PHP Utilities::toBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WindowsAzure\Common\Internal\Utilities的用法示例。


在下文中一共展示了Utilities::toBoolean方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 /**
  * Creates object from $parsedResponse.
  * 
  * @param array $parsedResponse XML response parsed into array.
  * 
  * @return WindowsAzure\Common\Models\RetentionPolicy
  */
 public static function create($parsedResponse)
 {
     $result = new RetentionPolicy();
     $result->setEnabled(Utilities::toBoolean($parsedResponse['Enabled']));
     if ($result->getEnabled()) {
         $result->setDays(intval($parsedResponse['Days']));
     }
     return $result;
 }
开发者ID:southworkscom,项目名称:vscom,代码行数:16,代码来源:RetentionPolicy.php

示例2: create

 /**
  * Creates object from $parsedResponse.
  * 
  * @param array $parsedResponse XML response parsed into array.
  * 
  * @return WindowsAzure\Common\Models\Logging
  */
 public static function create($parsedResponse)
 {
     $result = new Logging();
     $result->setVersion($parsedResponse['Version']);
     $result->setDelete(Utilities::toBoolean($parsedResponse['Delete']));
     $result->setRead(Utilities::toBoolean($parsedResponse['Read']));
     $result->setWrite(Utilities::toBoolean($parsedResponse['Write']));
     $result->setRetentionPolicy(RetentionPolicy::create($parsedResponse['RetentionPolicy']));
     return $result;
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:17,代码来源:Logging.php

示例3: create

 /**
  * Creates object from $parsedResponse.
  * 
  * @param array $parsedResponse XML response parsed into array.
  * 
  * @return WindowsAzure\Common\Models\Metrics
  */
 public static function create($parsedResponse)
 {
     $result = new Metrics();
     $result->setVersion($parsedResponse['Version']);
     $result->setEnabled(Utilities::toBoolean($parsedResponse['Enabled']));
     if ($result->getEnabled()) {
         $result->setIncludeAPIs(Utilities::toBoolean($parsedResponse['IncludeAPIs']));
     }
     $result->setRetentionPolicy(RetentionPolicy::create($parsedResponse['RetentionPolicy']));
     return $result;
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:18,代码来源:Metrics.php

示例4: testSetEnabled

 /**
  * @covers WindowsAzure\Common\Models\RetentionPolicy::setEnabled
  */
 public function testSetEnabled()
 {
     // Setup
     $sample = TestResources::getServicePropertiesSample();
     $retentionPolicy = new RetentionPolicy();
     $expected = Utilities::toBoolean($sample['Logging']['RetentionPolicy']['Enabled']);
     // Test
     $retentionPolicy->setEnabled($expected);
     // Assert
     $actual = $retentionPolicy->getEnabled();
     $this->assertEquals($expected, $actual);
 }
开发者ID:jdruid,项目名称:Microsoft-Azure-PHP-SDK-Storage,代码行数:15,代码来源:RetentionPolicyTest.php

示例5: unserializeQueryValue

 /**
  * Converts the value into its proper type.
  * 
  * @param string $type  The edm type.
  * @param string $value The edm value.
  * 
  * @return mix
  * 
  * @throws \InvalidArgumentException
  */
 public static function unserializeQueryValue($type, $value)
 {
     // Having null value means that the user wants to remove the property name
     // associated with this value. Leave the value as null so this hold.
     if (is_null($value)) {
         return null;
     } else {
         switch ($type) {
             case self::GUID:
             case self::STRING:
             case self::INT64:
             case null:
                 // NULL also is treated as EdmType::STRING
                 return strval($value);
             case self::BINARY:
                 return base64_decode($value);
             case self::DATETIME:
                 return Utilities::convertToDateTime($value);
             case self::BOOLEAN:
                 return Utilities::toBoolean($value);
             case self::DOUBLE:
                 return doubleval($value);
             case self::INT32:
                 return intval($value);
             default:
                 throw new \InvalidArgumentException();
         }
     }
 }
开发者ID:pankajadhyapak,项目名称:um_new,代码行数:39,代码来源:EdmType.php

示例6: testToBoolean

 /**
  * @covers WindowsAzure\Common\Internal\Utilities::toBoolean
  */
 public function testToBoolean()
 {
     // Setup
     $value = 'true';
     $expected = true;
     // Test
     $actual = Utilities::toBoolean($value);
     // Assert
     $this->assertTrue(is_bool($actual));
     $this->assertEquals($expected, $actual);
 }
开发者ID:southworkscom,项目名称:azure-sdk-for-php,代码行数:14,代码来源:UtilitiesTest.php

示例7: testSetIncludeAPIs

 /**
  * @covers WindowsAzure\Common\Models\Metrics::setIncludeAPIs
  */
 public function testSetIncludeAPIs()
 {
     // Setup
     $sample = TestResources::getServicePropertiesSample();
     $metrics = new Metrics();
     $expected = Utilities::toBoolean($sample['Metrics']['IncludeAPIs']);
     // Test
     $metrics->setIncludeAPIs($expected);
     // Assert
     $actual = $metrics->getIncludeAPIs();
     $this->assertEquals($expected, $actual);
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:15,代码来源:MetricsTest.php

示例8: testSetDelete

 /**
  * @covers WindowsAzure\Common\Models\Logging::setDelete
  */
 public function testSetDelete()
 {
     // Setup
     $sample = TestResources::getServicePropertiesSample();
     $logging = new Logging();
     $expected = Utilities::toBoolean($sample['Logging']['Delete']);
     // Test
     $logging->setDelete($expected);
     // Assert
     $actual = $logging->getDelete();
     $this->assertEquals($expected, $actual);
 }
开发者ID:rdohms,项目名称:azure-sdk-for-php,代码行数:15,代码来源:LoggingTest.php

示例9: create

 /**
  * Creates a new Deployment from parsed response body.
  * 
  * @param array $parsed The parsed response body in array representation.
  * 
  * @return Deployment
  */
 public static function create($parsed)
 {
     $result = new Deployment();
     $name = Utilities::tryGetValue($parsed, Resources::XTAG_NAME);
     $label = Utilities::tryGetValue($parsed, Resources::XTAG_LABEL);
     $url = Utilities::tryGetValue($parsed, Resources::XTAG_URL);
     $locked = Utilities::tryGetValue($parsed, Resources::XTAG_LOCKED);
     $rollbackAllowed = Utilities::tryGetValue($parsed, Resources::XTAG_ROLLBACK_ALLOWED);
     $sdkVersion = Utilities::tryGetValue($parsed, Resources::XTAG_SDK_VERSION);
     $inputEndpointList = Utilities::tryGetKeysChainValue($parsed, Resources::XTAG_INPUT_ENDPOINT_LIST, Resources::XTAG_INPUT_ENDPOINT);
     $roleList = Utilities::tryGetKeysChainValue($parsed, Resources::XTAG_ROLE_LIST, Resources::XTAG_ROLE);
     $roleInstanceList = Utilities::tryGetKeysChainValue($parsed, Resources::XTAG_ROLE_INSTANCE_LIST, Resources::XTAG_ROLE_INSTANCE);
     $status = Utilities::tryGetValue($parsed, Resources::XTAG_STATUS);
     $slot = Utilities::tryGetValue($parsed, Resources::XTAG_DEPLOYMENT_SLOT);
     $privateId = Utilities::tryGetValue($parsed, Resources::XTAG_PRIVATE_ID);
     $configuration = Utilities::tryGetValue($parsed, Resources::XTAG_CONFIGURATION);
     $upgradeDomainCount = Utilities::tryGetValue($parsed, Resources::XTAG_UPGRADE_DOMAIN_COUNT);
     $upgradeStatus = Utilities::tryGetValue($parsed, Resources::XTAG_UPGRADE_STATUS);
     $result->setConfiguration($configuration);
     $result->setLabel($label);
     $result->setLocked(Utilities::toBoolean($locked));
     $result->setName($name);
     $result->setPrivateId($privateId);
     $result->setRollbackAllowed(Utilities::toBoolean($rollbackAllowed));
     $result->setSdkVersion($sdkVersion);
     $result->setSlot($slot);
     $result->setStatus($status);
     $result->setUpgradeDomainCount(intval($upgradeDomainCount));
     $result->setUpgradeStatus(UpgradeStatus::create($upgradeStatus));
     $result->setUrl($url);
     $result->setRoleInstanceList(Utilities::createInstanceList(Utilities::getArray($roleInstanceList), 'WindowsAzure\\ServiceManagement\\Models\\RoleInstance'));
     $result->setRoleList(Utilities::createInstanceList(Utilities::getArray($roleList), 'WindowsAzure\\ServiceManagement\\Models\\Role'));
     $result->setInputEndpointList(Utilities::createInstanceList(Utilities::getArray($inputEndpointList), 'WindowsAzure\\ServiceManagement\\Models\\InputEndpoint'));
     return $result;
 }
开发者ID:mat33470,项目名称:PFA,代码行数:42,代码来源:Deployment.php


注:本文中的WindowsAzure\Common\Internal\Utilities::toBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。