本文整理汇总了PHP中Zend_Service_WindowsAzure_Storage_TableEntity类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Service_WindowsAzure_Storage_TableEntity类的具体用法?PHP Zend_Service_WindowsAzure_Storage_TableEntity怎么用?PHP Zend_Service_WindowsAzure_Storage_TableEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Service_WindowsAzure_Storage_TableEntity类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _resolveAttributes
/**
* Resolve table values to attributes
*
* @param Zend_Service_WindowsAzure_Storage_TableEntity $entity
* @return array
*/
protected function _resolveAttributes(Zend_Service_WindowsAzure_Storage_TableEntity $entity)
{
$result = array();
foreach ($entity->getAzureValues() as $attr) {
$result[$attr->Name] = $attr->Value;
}
return $result;
}
示例2: _generateAzureRepresentation
/**
* Generate Azure representation from entity (creates atompub markup from properties)
*
* @param Zend_Service_WindowsAzure_Storage_TableEntity $entity
* @return string
*/
protected function _generateAzureRepresentation(Zend_Service_WindowsAzure_Storage_TableEntity $entity = null)
{
// Generate Azure representation from entity
$azureRepresentation = array();
$azureValues = $entity->getAzureValues();
foreach ($azureValues as $azureValue) {
$value = array();
$value[] = '<d:' . $azureValue->Name;
if ($azureValue->Type != '') {
$value[] = ' m:type="' . $azureValue->Type . '"';
}
if (is_null($azureValue->Value)) {
$value[] = ' m:null="true"';
}
$value[] = '>';
if (!is_null($azureValue->Value)) {
if (strtolower($azureValue->Type) == 'edm.boolean') {
$value[] = $azureValue->Value == true ? '1' : '0';
} else {
if (strtolower($azureValue->Type) == 'edm.datetime') {
$value[] = $this->_convertToEdmDateTime($azureValue->Value);
} else {
$value[] = htmlspecialchars($azureValue->Value);
}
}
}
$value[] = '</d:' . $azureValue->Name . '>';
$azureRepresentation[] = implode('', $value);
}
return implode('', $azureRepresentation);
}
示例3: setAzureValues
/**
* Set Azure values
*
* @param array $values
* @param boolean $throwOnError Throw Zend_Service_WindowsAzure_Exception when a property is not specified in $values?
* @throws Zend_Service_WindowsAzure_Exception
*/
public function setAzureValues($values = array(), $throwOnError = false)
{
// Set parent values
parent::setAzureValues($values, false);
// Set current values
foreach ($values as $key => $value) {
$this->{$key} = $value;
}
}