Forums / Extensions / eZ Flow / Implemented Ezpagetype unserializeContentClassAttribute

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Implemented Ezpagetype unserializeContentClassAttribute

Author Message

Matteo Mosangini

Wednesday 22 July 2009 7:20:47 am

Ezpagetype datatype doesn't contain unserializeContentClassAttribute and serializeContentClassAttribute, because I needed to export a class in which I use such attribute I implemented those methods:

 function serializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode ){

        $classContent=serialize($content);
        $default_layout =$classAttribute->attribute('data_text1');
        $dom = new DOMDocument( '1.0', 'utf-8' );
        $domRoot = $dom->documentElement;

                //DefaultLayout
                $defaultLayoutNode = $attributeParametersNode->ownerDocument->createElement( 'default-layout', $default_layout);
                $attributeParametersNode->appendChild( $defaultLayoutNode );
	}


 function unserializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode )
    {
      
	

            $default_layout = $attributeParametersNode->getElementsByTagName( 'default-layout' )->item(0)->textContent;
            $classAttribute->setAttribute("data_text1",$default_layout);
	}