public function toXML( DOMDocument $dom )
    {
        if ( !$this->XMLStorable )
        {
            return false;
        }

        $itemNode = $dom->createElement( 'item' );

        foreach ( $this->attributes as $attrName => $attrValue )
        {
            switch ( $attrName )
            {
                case 'id':
                    $itemNode->setAttribute( 'id', $attrValue );
                    break;

                case 'action':
                    $itemNode->setAttribute( 'action', $attrValue );
                    break;

                default:
                    $node = $dom->createElement( $attrName );
                    $nodeValue = $dom->createTextNode( $attrValue );
                    $node->appendChild( $nodeValue );
                    $itemNode->appendChild( $node );
                    break;
            }
        }

        return $itemNode;
    }
public function toXML( DOMDocument $dom )
    {
        if ( !$this->XMLStorable )
        {
            return false;
        }

        $itemNode = $dom->createElement( 'item' );

        foreach ( $this->attributes as $attrName => $attrValue )
        {
            switch ( $attrName )
            {
                case 'id':
                    $itemNode->setAttribute( 'id', $attrValue );
                    break;

                case 'action':
                    $itemNode->setAttribute( 'action', $attrValue );
                    break;

                default:
                    $node = $dom->createElement( $attrName );
                    $nodeValue = $dom->createTextNode( $attrValue );
                    $node->appendChild( $nodeValue );
                    $itemNode->appendChild( $node );
                    break;
            }
        }

        return $itemNode;
    }
public function toXML ( DOMDocument $ dom ) { if ( ! $ this -> XMLStorable ) { return false ; } $ itemNode = $ dom -> createElement ( 'item' ) ; foreach ( $ this -> attributes as $ attrName => $ attrValue ) { switch ( $ attrName ) { case 'id' : $ itemNode -> setAttribute ( 'id' , $ attrValue ) ; break ; case 'action' : $ itemNode -> setAttribute ( 'action' , $ attrValue ) ; break ; default : $ node = $ dom -> createElement ( $ attrName ) ; $ nodeValue = $ dom -> createTextNode ( $ attrValue ) ; $ node -> appendChild ( $ nodeValue ) ; $ itemNode -> appendChild ( $ node ) ; break ; } } return $ itemNode ; }
Creates DOMElement with item data

@param DOMDocument $dom
@return DOMElement
Creates DOMElement with item data