src/POData/Writers/Atom/AtomODataWriter.php
/**
     * Serialize the exception
     *
     * @param ODataException $exception              Exception to serialize
     * @param boolean        $serializeInnerException if set to true,
     * serialize the inner exception if $exception is an ODataException.
     * 
     * @return string
     */
Serialize the exception
@param ODataException $exception              Exception to serialize
@param boolean        $serializeInnerException if set to true,
serialize the inner exception if $exception is an ODataException.

@return string
Serialize the exception @param ODataException $exception Exception to serialize @param boolean $serializeInnerException if set to true serialize the inner exception if $exception is an ODataException . @return string
public static function serializeException(ODataException $exception, $serializeInnerException)
    {
        $xmlWriter = new \XMLWriter();
        $xmlWriter->openMemory();
        $xmlWriter->startDocument('1.0', 'UTF-8', 'yes');
        $xmlWriter->setIndent(4);
        $xmlWriter->startElement(ODataConstants::XML_ERROR_ELEMENT_NAME);
        $xmlWriter->writeAttribute(
            ODataConstants::XMLNS_NAMESPACE_PREFIX, 
            ODataConstants::ODATA_METADATA_NAMESPACE
        );
        $xmlWriter->endAttribute();
        $xmlWriter->startElement(ODataConstants::XML_ERROR_CODE_ELEMENT_NAME);
        if ($exception->getCode() != null) {
            $xmlWriter->text($exception->getCode());
        }
        $xmlWriter->endElement();
        $xmlWriter->startElement(ODataConstants::XML_ERROR_MESSAGE_ELEMENT_NAME);
        $xmlWriter->text($exception->getMessage());
        $xmlWriter->endElement();
        $xmlWriter->endElement();
        $xmlWriter->endDocument();
        return $xmlWriter->outputMemory(true);
    }
public static function serializeException ( ODataException $ exception , $ serializeInnerException ) { $ xmlWriter = new \ XMLWriter ( ) ; $ xmlWriter -> openMemory ( ) ; $ xmlWriter -> startDocument ( '1.0' , 'UTF-8' , 'yes' ) ; $ xmlWriter -> setIndent ( 4 ) ; $ xmlWriter -> startElement ( ODataConstants :: XML_ERROR_ELEMENT_NAME ) ; $ xmlWriter -> writeAttribute ( ODataConstants :: XMLNS_NAMESPACE_PREFIX , ODataConstants :: ODATA_METADATA_NAMESPACE ) ; $ xmlWriter -> endAttribute ( ) ; $ xmlWriter -> startElement ( ODataConstants :: XML_ERROR_CODE_ELEMENT_NAME ) ; if ( $ exception -> getCode ( ) != null ) { $ xmlWriter -> text ( $ exception -> getCode ( ) ) ; } $ xmlWriter -> endElement ( ) ; $ xmlWriter -> startElement ( ODataConstants :: XML_ERROR_MESSAGE_ELEMENT_NAME ) ; $ xmlWriter -> text ( $ exception -> getMessage ( ) ) ; $ xmlWriter -> endElement ( ) ; $ xmlWriter -> endElement ( ) ; $ xmlWriter -> endDocument ( ) ; return $ xmlWriter -> outputMemory ( true ) ; }
Serialize the exception
 @param ODataException $exception              Exception to serialize
 @param boolean        $serializeInnerException if set to true,
 serialize the inner exception if $exception is an ODataException.
Serialize the exception @param ODataException $exception Exception to serialize @param boolean $serializeInnerException if set to true serialize the inner exception if $exception is an ODataException .
//$xmlWriter->writeAttributeNs( //    ODataConstants::XMLNS_NAMESPACE_PREFIX,  //    ODataConstants::XML_NAMESPACE_PREFIX,  //    ODataConstants::XML_NAMESPACE,  //    null //);