Forums / Developer / Problem with adding an object in a script program / Comment50221
André R.
Thursday 02 October 2008 9:33:11 am
Here is an example used on a 4.0 site, hope it helps:
$newNodeAssignment = eZNodeAssignment::create( array( 'contentobject_id' => $newObjectID, 'contentobject_version' => $newObject->attribute( 'current_version' ), 'parent_node' => $node->attribute('node_id'), 'is_main' => 1 ) ); $newNodeAssignment->store(); // later in the code when the object is stored as well eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $newObjectID, 'version' => 1 ) );
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription @: http://twitter.com/andrerom