marshalToString() public method

public marshalToString ( object $mappedObject ) : string
$mappedObject object
return string
 /**
  * @test
  * @dataProvider typeMappingProvider
  */
 public function itShouldProduceExactXmlForAttributeOfType($object, $resultString)
 {
     $xml = $this->marshaller->marshalToString($object);
     $this->assertTrue(strlen($xml) > 0);
     $this->assertXmlStringEqualsXmlString('<?xml version="1.0" encoding="UTF-8"?>' . $resultString, $xml);
     $otherObject = $this->marshaller->unmarshalFromString($xml);
     $this->assertEquals($object->i, $otherObject->i);
     $this->assertEquals($object, $otherObject);
 }
Beispiel #2
0
 /**
  * Inserts this xml entity into the storage system
  *
  * @param  $xmlEntity
  * @return bool|int
  */
 public function insert($xmlEntity)
 {
     $identifier = $this->metadata->getIdentifierValue($xmlEntity);
     $xml = $this->marshaller->marshalToString($xmlEntity);
     return $this->storage->insert($this->metadata, $identifier, $xml);
 }