Object relation types

Author Message

Kévin S.

Wednesday 07 July 2010 2:54:01 am

Hello everyone !

I have read the doc for all three types of relations (parent/children, common relations and attribute object_relation), and I need to know more about them : when to use a type of relation instead of another ?

Especially for attribute relations : in some tests, I've noticed that it doesn't provide full access to linked objects. In templates, I can only access 11 properties, such as "identifier", "priority", but not the data_map.

I don't understand the attribute relations if one can't reach the content of related objects from templates !

Any explaination would be very welcome.

Kévin

André R.

Wednesday 07 July 2010 8:28:24 am

That's probably beacuse it does not fetch the relations for you, just provide meta information about the relation.

Use fetch function to fetch them in the order you want for instance:

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/modules/content/fetch_functions/related_objects

Pay attention to "all_relations":

 The "all_relations" parameter makes it possible to fetch all types of relations (when set to TRUE).
This parameter is not required and the default value is FALSE.
In addition, the value of this parameter can also be an array.
The array may consist of the following strings: "common", "xml_link", "xml_embed" and "attribute"

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Kévin S.

Wednesday 07 July 2010 9:04:45 am

Oh, OK thank you !

Could you give an example of use of each relation (attribute, children and common) ?

I can't choose between them, they all seem to be technically the same...

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 02:09:23
Script start
Timing: Jan 18 2025 02:09:23
Module start 'layout'
Timing: Jan 18 2025 02:09:23
Module start 'content'
Timing: Jan 18 2025 02:09:24
Module end 'content'
Timing: Jan 18 2025 02:09:24
Script end

Main resources:

Total runtime0.6932 sec
Peak memory usage4,096.0000 KB
Database Queries58

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.0078152.6094
Module start 'layout' 0.00530.0025 741.617239.4141
Module start 'content' 0.00790.6839 781.0313536.0547
Module end 'content' 0.69180.0014 1,317.085912.1875
Script end 0.6932  1,329.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4775160.0002
Check MTime0.00130.1904160.0001
Mysql Total
Database connection0.00050.066310.0005
Mysqli_queries0.645693.1336580.0111
Looping result0.00060.0835560.0000
Template Total0.663195.720.3315
Template load0.00190.273020.0009
Template processing0.661295.379420.3306
Template load and register function0.00020.031710.0002
states
state_id_array0.00110.161710.0011
state_identifier_array0.00120.175920.0006
Override
Cache load0.00150.2230210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.080120.0003
Fetch class attribute name0.00160.233140.0004
XML
Image XML parsing0.00070.105320.0004
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00120.1675170.0001
String conversion0.00000.001040.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.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: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs