Get attributes from related objects - php script

Author Message

Romain Dausset

Friday 27 April 2007 6:01:52 am

Hi all,

I'm trying to get attributes from a related object.

For example 'id' or 'main_node_id' of my related objects.

I found this post which show how to set an object relation attribute.
http://ez.no/community/forum/developer/add_object_relation_attribute_type_within_a_php_script

But I didn't succeded in my problem...

Any ideas ?

Thx,
Rom.

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

Romain Dausset

Monday 30 April 2007 4:30:16 am

A solution :

// id de l'attribut relation
$attributeID = 398;

$relatedObjects =& $object->relatedContentObjectList( false, false, $attributeID );

foreach( $relatedObjects as $relatedObject)
{
$userID = $relatedObject->attribute('id');
}

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

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

Main resources:

Total runtime1.3959 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.0051 588.0469152.6406
Module start 'layout' 0.00510.0029 740.687539.4766
Module start 'content' 0.00801.3864 780.1641492.4453
Module end 'content' 1.39450.0014 1,272.60948.1250
Script end 1.3959  1,280.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2254160.0002
Check MTime0.00150.1048160.0001
Mysql Total
Database connection0.00070.052910.0007
Mysqli_queries1.349096.6354520.0259
Looping result0.00050.0363500.0000
Template Total1.363697.720.6818
Template load0.00210.153620.0011
Template processing1.361597.531820.6807
Template load and register function0.00010.008810.0001
states
state_id_array0.00160.113310.0016
state_identifier_array0.00130.092320.0006
Override
Cache load0.00170.1248230.0001
Sytem overhead
Fetch class attribute can translate value0.00050.037410.0005
Fetch class attribute name0.00190.135430.0006
XML
Image XML parsing0.00250.179710.0025
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00260.1850160.0002
String conversion0.00000.000640.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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/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.0002 secs