node vs. object

Author Message

Marko Žmak

Wednesday 29 September 2004 5:33:39 am

What is the difference between $node.object and $node?

Is it better to use $node.object.data_map or $node.data_map?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Balazs Halasy

Wednesday 29 September 2004 5:41:51 am

$node points to the content node itself (which can be thought of as an encapsulation of an object within the content node tree).

$node.object points to the object itself (the object being encapsulated/pointed to by the node)

$node.object.data_map and $node.data_map are the same (both point to the attributes of the *current* version of the object) - the most "correct" notation is $node.object.data_map. $node.data_map is just an alias/shortcut (makes it easier/faster to remember/write). Doesn't really matter which one you're using, since they do exactly the same thing (point to the attributes of the current version of the object which is encapsulated by (or pointed to by - just another way of seeing it) a particular node.

If you're unsure about nodes and objects, I strongly recommend reading the following doc pages:

http://ez.no/ez_publish/documentation/ez_publish_basics/content_management_in_ez_publish/the_content_object

and especially this one:

http://ez.no/ez_publish/documentation/ez_publish_basics/content_management_in_ez_publish/objects_nodes_and_the_content_node_tree

Balazs

Marko Žmak

Wednesday 29 September 2004 6:13:01 am

Thx for the info. I still have one question. Regarding the implementation of the EZ engine, which one is faster:

- to address $node.data_map
- or to address $node.object.data_map

It would seem that the second one is slower beacuse has one reference more. Is it so? And if yes, how much?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Frederik Holljen

Wednesday 29 September 2004 7:19:10 am

$node.data_map is an alias of $node.object.data_map. There should be no real speed difference. I suggest using the latter since it is more "correct".

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 19:34:52
Script start
Timing: Jan 18 2025 19:34:52
Module start 'layout'
Timing: Jan 18 2025 19:34:52
Module start 'content'
Timing: Jan 18 2025 19:34:52
Module end 'content'
Timing: Jan 18 2025 19:34:52
Script end

Main resources:

Total runtime0.9306 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 587.7891152.6094
Module start 'layout' 0.00500.0033 740.398439.4297
Module start 'content' 0.00830.9209 779.8281601.1797
Module end 'content' 0.92920.0014 1,381.007812.1953
Script end 0.9306  1,393.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3232160.0002
Check MTime0.00130.1435160.0001
Mysql Total
Database connection0.00060.068710.0006
Mysqli_queries0.874994.0195620.0141
Looping result0.00060.0596600.0000
Template Total0.897496.420.4487
Template load0.00220.231320.0011
Template processing0.895296.197120.4476
Template load and register function0.00010.013210.0001
states
state_id_array0.00090.101210.0009
state_identifier_array0.00100.112620.0005
Override
Cache load0.00170.1864250.0001
Sytem overhead
Fetch class attribute can translate value0.00070.071430.0002
Fetch class attribute name0.00090.097870.0001
XML
Image XML parsing0.00170.184630.0006
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00130.1356300.0000
String conversion0.00000.002640.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs