Use DOMDocument to retrieve the value in DateTimeTypeConverter

This commit is contained in:
Francis Besset 2011-08-27 18:07:30 +02:00
parent ce5c46408a
commit db4c599af6

View File

@ -31,7 +31,10 @@ class DateTimeTypeConverter implements TypeConverterInterface
public function convertXmlToPhp(SoapRequest $request, $data)
{
return new \DateTime(strip_tags($data));
$doc = new \DOMDocument();
$doc->loadXML($data);
return new \DateTime($doc->textContent);
}
public function convertPhpToXml(SoapResponse $response, $data)