Forums / Developer / php: having object_id I need node_id / Comment57736
Nicolas Pastorino
Wednesday 17 March 2010 7:20:37 am
Hi Jorge,
Two solutions from here. The first one should be better in terms of performances :
// Better performances : // Warning: the $node variable is an array, not an object. $node = eZContentObjectTreeNode::fetchByContentObjectID( $objectId, false ); $nodeId = $node['node_id']
The second one gives you back the fully feature node object :
// Full object retrieval : // The $node variable is an instance of the eZContentObjectTreeNode class $node = eZContentObjectTreeNode::fetchByContentObjectID( $objectId ); $nodeId = $node->attribute( 'node_id' );
Hope it helped :)
-- Nicolas Pastorino Director Community - eZ Member of the Community Project Board eZ Publish Community on twitter: http://twitter.com/ezcommunity t : http://twitter.com/jeanvoye G+ : http://plus.tl/jeanvoye