コード例 #1
0
 /**
  * @covers WindowsAzure\Table\Models\EdmType::unserializeQueryValue
  */
 public function testUnserializeQueryValueWithInvalid()
 {
     // Assert
     $this->setExpectedException('\\InvalidArgumentException');
     // Test
     EdmType::unserializeQueryValue('7amada', '1233');
 }
コード例 #2
0
 /**
  * Parses an entity entry from given SimpleXML object.
  * 
  * @param \SimpleXML $result The SimpleXML object representing the entity.
  * 
  * @return \WindowsAzure\Table\Models\Entity
  */
 private function _parseOneEntity($result)
 {
     $prefix = $this->_dataServicesMetadataPrefix;
     $prop = $result->content->xpath(".//{$prefix}:properties");
     $prop = $prop[0]->children($this->_dataServicesNamespaceName);
     $entity = new Entity();
     // Set ETag
     $etag = $result->attributes($this->_dataServicesMetadataNamespaceName);
     $etag = $etag[Resources::ETAG];
     $entity->setETag((string) $etag);
     foreach ($prop as $key => $value) {
         $attributes = $value->attributes($this->_dataServicesMetadataNamespaceName);
         $type = $attributes['type'];
         $isnull = $attributes['null'];
         $value = EdmType::unserializeQueryValue((string) $type, $value);
         $entity->addProperty((string) $key, is_null($type) ? null : (string) $type, $isnull ? null : $value);
     }
     return $entity;
 }