Tuesday 30 August 2005 9:05:47 am
I finally managed to import data from an excel-file, and publish the content in some new objects/nodes. But now I need to use these new nodes as parents to a lot more objects/nodes. The code used to assign the new objects no nodes is pretty much a copy of some code found in the eZ-book:
$nodeAssignment =& eZNodeAssignment::create( array(
'contentobject_id' => $contentObject->attribute('id'),
'contentobject_version' => $contentObject->attribute('current_version' ),
'parent_node' => $parentContentObjectTreeNode->attribute( 'node_id' ),
'is_main' => 1
));
$nodeAssignment->store();
$newNodeID=$nodeAssignment->attribute('id');
I hoped the $newNodeID would actually contain the node_id, but it don't. It's the id of the eznodeassignment-table. I tried use eZContentObjectTreeNode instead of eZNodeAssignment, but I only endend up emptying the ezcontentobjecttreenode-table :-) So, how can I get the node_id of a newly created object, just assiged to a node?
|