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);
	}


Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 04:20:29
Script start
Timing: Jan 18 2025 04:20:29
Module start 'layout'
Timing: Jan 18 2025 04:20:29
Module start 'content'
Timing: Jan 18 2025 04:20:29
Module end 'content'
Timing: Jan 18 2025 04:20:29
Script end

Main resources:

Total runtime0.1135 sec
Peak memory usage4,096.0000 KB
Database Queries48

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.1875152.6563
Module start 'layout' 0.00600.0045 740.843839.5078
Module start 'content' 0.01050.1015 780.3516441.9609
Module end 'content' 0.11210.0014 1,222.31258.1016
Script end 0.1135  1,230.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00413.5774160.0003
Check MTime0.00151.2882160.0001
Mysql Total
Database connection0.00100.899410.0010
Mysqli_queries0.073564.7752480.0015
Looping result0.00060.4931460.0000
Template Total0.080270.720.0401
Template load0.00221.925520.0011
Template processing0.078068.738120.0390
Template load and register function0.00010.071410.0001
states
state_id_array0.00070.637810.0007
state_identifier_array0.00080.684420.0004
Override
Cache load0.00181.560160.0003
Sytem overhead
Fetch class attribute can translate value0.00121.080910.0012
Fetch class attribute name0.00110.956620.0005
XML
Image XML parsing0.00040.316110.0004
class_abstraction
Instantiating content class attribute0.00000.003420.0000
General
dbfile0.00080.6712160.0000
String conversion0.00000.035140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs