Share » Forums » Developer » Get the new node_id

Get the new node_id

Get the new node_id

Tuesday 30 August 2005 9:05:47 am - 3 replies

Modified on Tuesday 30 August 2005 9:06:59 am by Roy Bøhmer

Author Message

Kristof Coomans

Tuesday 30 August 2005 9:46:57 pm

After you've published the content, you can fetch the node and node ID with the following code:

$objectID =& $contentObject->attribute( 'id' );
$parentNodeID =& $parentContentObjectTreeNode->attribute( 'node_id' );

$node =& eZContentObjectTreeNode::fetchNode( $objectID, $parentNodeID );

$nodeID =& $node->attribute( 'node_id' );

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

Roy Bøhmer

Wednesday 31 August 2005 1:08:02 pm

Thank you, Kristof!
I hoped there would be a solution where I could avoid another fetch, but your suggestion seems to be the solution.
Since I know the new nodes always will be the main nodes I might use the code

$nodeID=$contentObject->mainNodeID();

I found this function after I did the original post.

Again, thank you!

Roy

Clemens T

Thursday 01 September 2005 2:05:01 am

Thanks, I was looking for this as well!

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

36 542 Users on board!

Forums menu