Fetching the object in an ezobjectrelation

Author Message

Jason Filby

Wednesday 28 January 2004 10:19:15 am

Hi all

I posted a message on this a short time back, but never got it working. I need to fetch the object contained in an ezobjectrelation, so that I can obtain specific attributes in that object. I don't think that it works at all like an ezobjectrelationlist.

Thanks
Jason

James Packham

Thursday 29 January 2004 1:56:08 am

Forget about the database.

Fetch the object and then use it's attributes in your code, not the other way around.

Regards,

James

Jason Filby

Thursday 29 January 2004 3:13:52 am

Hi James

Fetching the object and refering to its attributes is exactly what I want to do. But how exactly do I do this?

Thanks
Jason

James Packham

Thursday 29 January 2004 5:49:03 am

I think this might help you:

In your template write {$object_you_just_fetched|attribute(show)}

Will show you all the attributes available for that object, for example if you saw something like

data_map array
>name string

then your object would have attributes called data_map (an array) and name (a string inside data_map)

so you could call name with:

{$your_object_name.data_map.name}

see http://www.ez.no/ez_publish/documentation/customization/custom_design/template_variables_set_by_ezpublish there's more documentation on this as well, I'd scan through the "building an ezpublish site tutorial"

Regards.

~James~

Jason Filby

Thursday 29 January 2004 6:28:16 am

Hi James

Yes, I know about that part of it. My question is how exactly do you fetch that object? I'm working with an object that has content.data_map.my_relation_object (for example). How do I fetch the actual object in my_relation_object?

Thanks
Jason

Jason Filby

Wednesday 04 February 2004 10:22:47 am

Thanks for the help James. The final result - for anyone interested - can be found here:
http://ez.no/community/forum/setup_design/fetching_an_object_using_contentobject_id

Cheers
Jason

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

Main resources:

Total runtime1.1538 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 588.0469152.6406
Module start 'layout' 0.00910.0047 740.687539.4766
Module start 'content' 0.01381.1385 780.1641538.8359
Module end 'content' 1.15220.0016 1,319.000012.1250
Script end 1.1538  1,331.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2834160.0002
Check MTime0.00130.1137160.0001
Mysql Total
Database connection0.00140.125310.0014
Mysqli_queries1.086394.1460660.0165
Looping result0.00060.0544640.0000
Template Total1.112296.420.5561
Template load0.00200.175820.0010
Template processing1.110296.214520.5551
Template load and register function0.00020.020510.0002
states
state_id_array0.00170.147310.0017
state_identifier_array0.00180.155920.0009
Override
Cache load0.00170.1472410.0000
Sytem overhead
Fetch class attribute can translate value0.00080.065420.0004
Fetch class attribute name0.00120.106070.0002
XML
Image XML parsing0.00060.048520.0003
class_abstraction
Instantiating content class attribute0.00000.001780.0000
General
dbfile0.00100.0846160.0001
String conversion0.00000.001140.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs