Share » Forums » Developer » Getting content class object attributes

Getting content class object attributes

Getting content class object attributes

Thursday 24 August 2006 4:35:39 am - 3 replies

Author Message

Claudia Kosny

Thursday 24 August 2006 2:47:01 pm

Hi Børge

Try to fetch the contentobject of this node. The contentobject again has an attribute related_contentobject_array which should give you access to the information you want.

Greetings from Luxembourg

Claudia

Børge Warvik

Friday 25 August 2006 12:23:48 am

Hi

Thanks for the answer, but I can't seem to get it to work.

This just gives me an empty array:

$node = eZContentObjectTreeNode::fetch( $nodeID );
$coNode = eZContentObject::fetch( $node->ContentObjectID );

echo "<pre>";
print_r( $coNode->relatedContentObjectArray() );
echo "</pre>";

Could you mayby post some example code of what you mean?

Kristof Coomans

Friday 25 August 2006 1:45:23 am

Hello Børge

Try this:

$node = eZContentObjectTreeNode::fetch( $nodeID );
$object =& $node->attribute( 'object' );

echo "<pre>";
print_r( $object->relatedContentObjectList( false, false, $classAttributeID );
echo "</pre>";

where $classAttributeID is the id of the class attribute with related authors. You can also use a boolean false instead if you want all related objects (made on both object and object attribute level), and 0 (the default) for related objects made on object level.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu