Forums / Extensions / eZ Flow / Implemented Ezpagetype unserializeContentClassAttribute
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); }