Doctrine\OXM\Marshaller\XmlMarshaller::unmarshalFromStream PHP Method

unmarshalFromStream() public method

public unmarshalFromStream ( string $streamUri ) : object
$streamUri string
return object
    public function unmarshalFromStream($streamUri)
    {
        $reader = new XMLReader();
        if (!$reader->open($streamUri)) {
            throw MarshallerException::couldNotOpenStream($streamUri);
        }
        // Position at first detected element
        while ($reader->read() && $reader->nodeType !== XMLReader::ELEMENT) {
        }
        $mappedObject = $this->doUnmarshal($reader);
        $reader->close();
        return $mappedObject;
    }