Related Objects with relationship attributes

Author Message

paul bolger

Sunday 01 April 2007 4:26:20 pm

In a site I am developing we have a database of organisations, and a database of contacts which are associated with the organisations with the eZpublish object relations system. Some of the contacts are related to several organisations, but they may have different roles (manager, for instance) with each organisation.

I'm trying to come up with a way to handle this which doesn't involve duplicating the contact for each organisation they represent. Something like assigning the role as an attribute of the object relationship would do the trick, but I have no idea how you would implement this.

Would some sort of Custom Tag work for this?

Does anyone have any brilliant ideas?

Paul Bolger
Alice Springs Town Council

Paul Bolger

paul bolger

Sunday 01 April 2007 11:39:56 pm

Problem solved, but I'm still interested in others' opinions on whether I'm taking the right approach. I've decided to add a 'contacts' XML field to the organisations content class and add the contacts as a bulleted list of embedded objects which means I can add titles inline with the objects.

Paul Bolger

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 19 2025 04:26:59
Script start
Timing: Jan 19 2025 04:26:59
Module start 'layout'
Timing: Jan 19 2025 04:26:59
Module start 'content'
Timing: Jan 19 2025 04:26:59
Module end 'content'
Timing: Jan 19 2025 04:26:59
Script end

Main resources:

Total runtime0.8255 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.2891152.6406
Module start 'layout' 0.00660.0034 741.929739.4766
Module start 'content' 0.01010.8141 781.4063486.7344
Module end 'content' 0.82410.0014 1,268.14068.1250
Script end 0.8255  1,276.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.5432160.0003
Check MTime0.00150.1876160.0001
Mysql Total
Database connection0.00100.121410.0010
Mysqli_queries0.768893.1333520.0148
Looping result0.00060.0671500.0000
Template Total0.778894.320.3894
Template load0.00450.542720.0022
Template processing0.774393.789120.3871
Template load and register function0.00010.011310.0001
states
state_id_array0.00200.237310.0020
state_identifier_array0.00170.211620.0009
Override
Cache load0.00350.4253130.0003
Sytem overhead
Fetch class attribute can translate value0.00060.071810.0006
Fetch class attribute name0.00190.224630.0006
XML
Image XML parsing0.00050.054710.0005
class_abstraction
Instantiating content class attribute0.00000.001640.0000
General
dbfile0.00080.0992160.0001
String conversion0.00000.001240.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/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: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs