How add another parent node to user object

How add another parent node to user object

Monday 12 April 2004 11:34:05 am - 3 replies

Author Message

Björn Dieding@xrow.de

Monday 12 April 2004 9:57:06 pm

there is a little more to it

try this code

function & copyto (& $object,$node){
	$nodeAssignment =& eZNodeAssignment::create( array
		    	(
                  'contentobject_id' => $object->attribute( 'id' ),
                  'contentobject_version' => $object->attribute( 'current_version' ),
                  'parent_node' => $node,
                  'is_main' => 0
                 )
            );
    $nodeAssignment->store();
    #die("Here2".$node);
    $treenodegewerk = & eZContentObjectTreeNode::addChild($object->attribute( 'id' ),$node,true);
	$operationResult = eZOperationHandler::execute(
									'content', 'publish', array( 
									'object_id' => $object->attribute( 'id' ),
									'version' => $object->attribute( 'current_version' ) ) );
	 return eZContentObjectTreeNode::findNode($node,$object->attribute('id'),true); 
}

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Matej Ukmar

Tuesday 13 April 2004 12:55:03 pm

Bjorn thanks,
this helps a lot... and it works!!! :-)

I have just one more little question.
If I want to remove a node is it enough just to use

eZContentObjectTreeNode::remove(...

or is there also some extra "coding" to be done?

Regards,
Matey

Dominik Pich

Thursday 22 April 2004 1:32:15 am

Remove its assignments first... ?

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.