Forums / General / Last inserted NodeID?
Carlos Revillo
Friday 15 June 2007 1:25:28 am
Hi. I'm working with a extension. With this extension, a registered used can add new content to database. I use
include_once( 'lib/ezutils/classes/ezoperationhandler.php' ); $operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObjectID,'version' => 1 ) );
but, how can i get the node_id of the contentobject i have added? I want the user be subscribed to this node he has created so i need the node id for doing something like
$user=&eZUser::currentuser(); include_once( 'kernel/classes/notification/handler/ezsubtree/ezsubtreenotificationrule.php' ); $rule=eZSubtreeNotificationRule::create($node,$user->attribute("contentobject_id")); $rule->store();
Thank you.
Nabil Alimi
Friday 15 June 2007 2:07:16 am
Hi Carlos,
You might try something like :
$node = eZContentObjectTreeNode::fetchByContentObjectID( $contentObjectID )
This should retrieve the node related to the content object.
My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com eZ Publish Freelance developper. Feel free to contact me +33 674 367 057 nabil at assiki d0t fr
Friday 15 June 2007 2:37:57 am
yes. it works. thanks a lot.