src/POData/Writers/Atom/AtomODataWriter.php
/**
     * Write a property
     *
     * @param ODataProperty $property Property to be written
     * @param boolean       $isTopLevel     is link top level or not.
     * 
     * @return AtomODataWriter
     */
Write a property
@param ODataProperty $property Property to be written
@param boolean       $isTopLevel     is link top level or not.


Write a property @param ODataProperty $property Property to be written @param boolean $isTopLevel is link top level or not .
protected function beginWriteProperty(ODataProperty $property, $isTopLevel)
    {
        $this->xmlWriter->startElementNS(
            ODataConstants::ODATA_NAMESPACE_PREFIX,
            $property->name,
            null
        );
        if ($property->typeName!=null) {
            $this->xmlWriter->startAttributeNs(
                ODataConstants::ODATA_METADATA_NAMESPACE_PREFIX,
                ODataConstants::ATOM_TYPE_ATTRIBUTE_NAME,
                null
            );
            $this->xmlWriter->text($property->typeName);
        }
        if ($isTopLevel) {
            $this->xmlWriter->startAttribute(ODataConstants::XMLNS_NAMESPACE_PREFIX);
            $this->xmlWriter->text(ODataConstants::ODATA_METADATA_NAMESPACE);
            $this->xmlWriter->startAttributeNs(ODataConstants::XMLNS_NAMESPACE_PREFIX, ODataConstants::ODATA_NAMESPACE_PREFIX, null);
            $this->xmlWriter->text(ODataConstants::ODATA_NAMESPACE);
            $this->xmlWriter->startAttributeNs(ODataConstants::XMLNS_NAMESPACE_PREFIX, ODataConstants::ODATA_METADATA_NAMESPACE_PREFIX, null);
            $this->xmlWriter->text(ODataConstants::ODATA_METADATA_NAMESPACE);
        }
        if ($property->typeName!=null || $isTopLevel) {
            $this->xmlWriter->endAttribute();
        }
	    return $this;
    }
protected function beginWriteProperty ( ODataProperty $ property , $ isTopLevel ) { $ this -> xmlWriter -> startElementNS ( ODataConstants :: ODATA_NAMESPACE_PREFIX , $ property -> name , null ) ; if ( $ property -> typeName != null ) { $ this -> xmlWriter -> startAttributeNs ( ODataConstants :: ODATA_METADATA_NAMESPACE_PREFIX , ODataConstants :: ATOM_TYPE_ATTRIBUTE_NAME , null ) ; $ this -> xmlWriter -> text ( $ property -> typeName ) ; } if ( $ isTopLevel ) { $ this -> xmlWriter -> startAttribute ( ODataConstants :: XMLNS_NAMESPACE_PREFIX ) ; $ this -> xmlWriter -> text ( ODataConstants :: ODATA_METADATA_NAMESPACE ) ; $ this -> xmlWriter -> startAttributeNs ( ODataConstants :: XMLNS_NAMESPACE_PREFIX , ODataConstants :: ODATA_NAMESPACE_PREFIX , null ) ; $ this -> xmlWriter -> text ( ODataConstants :: ODATA_NAMESPACE ) ; $ this -> xmlWriter -> startAttributeNs ( ODataConstants :: XMLNS_NAMESPACE_PREFIX , ODataConstants :: ODATA_METADATA_NAMESPACE_PREFIX , null ) ; $ this -> xmlWriter -> text ( ODataConstants :: ODATA_METADATA_NAMESPACE ) ; } if ( $ property -> typeName != null || $ isTopLevel ) { $ this -> xmlWriter -> endAttribute ( ) ; } return $ this ; }
Write a property
 @param ODataProperty $property Property to be written
 @param boolean       $isTopLevel     is link top level or not.
Write a property @param ODataProperty $property Property to be written @param boolean $isTopLevel is link top level or not .