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.