public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('TariffInfo');

        // Required
        $node->appendChild($document->createElement('TariffCode', $this->getTariffCode()));

        // Optional
        if ($this->getDetailId() !== null) {
            $node->appendChild($document->createElement('DetailId', $this->getDetailId()));
        }
        if ($this->getSecondaryTariffCode() !== null) {
            $node->appendChild($document->createElement('SecondaryTariffCode', $this->getSecondaryTariffCode()));
        }
        if ($this->getSecondaryDetailId() !== null) {
            $node->appendChild($document->createElement('SecondaryDetailId', $this->getSecondaryDetailId()));
        }

        return $node;
    }
public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('TariffInfo');

        
        $node->appendChild($document->createElement('TariffCode', $this->getTariffCode()));

        
        if ($this->getDetailId() !== null) {
            $node->appendChild($document->createElement('DetailId', $this->getDetailId()));
        }
        if ($this->getSecondaryTariffCode() !== null) {
            $node->appendChild($document->createElement('SecondaryTariffCode', $this->getSecondaryTariffCode()));
        }
        if ($this->getSecondaryDetailId() !== null) {
            $node->appendChild($document->createElement('SecondaryDetailId', $this->getSecondaryDetailId()));
        }

        return $node;
    }
public function toNode ( DOMDocument $ document = null ) { if ( null === $ document ) { $ document = new DOMDocument ( ) ; } $ node = $ document -> createElement ( 'TariffInfo' ) ; // Required $ node -> appendChild ( $ document -> createElement ( 'TariffCode' , $ this -> getTariffCode ( ) ) ) ; // Optional if ( $ this -> getDetailId ( ) !== null ) { $ node -> appendChild ( $ document -> createElement ( 'DetailId' , $ this -> getDetailId ( ) ) ) ; } if ( $ this -> getSecondaryTariffCode ( ) !== null ) { $ node -> appendChild ( $ document -> createElement ( 'SecondaryTariffCode' , $ this -> getSecondaryTariffCode ( ) ) ) ; } if ( $ this -> getSecondaryDetailId ( ) !== null ) { $ node -> appendChild ( $ document -> createElement ( 'SecondaryDetailId' , $ this -> getSecondaryDetailId ( ) ) ) ; } return $ node ; }
@param null|DOMDocument $document

@return DOMElement
@param null|DOMDocument $document