Share » Forums » Developer » How To use eZOperationHandler::execute

How To use eZOperationHandler::execute

How To use eZOperationHandler::execute

Wednesday 30 April 2003 1:06:38 am - 2 replies

Author Message

Gunnstein Lye

Friday 02 May 2003 8:11:49 am

Show us the code you use, then it's easier to tell what could be wrong.

Petr Mrzena

Monday 05 May 2003 12:47:54 am

include_once( "kernel/classes/ezcontentclass.php" );
include_once( "kernel/classes/eznodeassignment.php");
include_once( "kernel/content/ezcontentoperationcollection.php" );

$node =& eZContentObjectTreeNode::fetch( 2 );
$parentContentObject =& $node->attribute( 'object' );
$sectionID = $parentContentObject->attribute( 'section_id' );

$class =& eZContentClass::fetch( 1 );
$contentObject =& $class->instantiate( 14, $sectionID );
$contentObject->setName( "MyNewFolder" );

$contentObject->store();

$nodeAssignment =& eZNodeAssignment::create( array(
'contentobject_id' => $contentObject->attribute( 'id' ),
'contentobject_version' => $contentObject->attribute( 'current_version' ),
'parent_node' => $node->attribute( 'node_id' ),
'is_main' => 1
)
);
$nodeAssignment->store();
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
$operationResult =& eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObject->attribute( 'id' ),
'version' =>1 ) );

$contentObject =& eZContentObject::fetch( $contentObject->attribute( 'id' ) );

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

36 542 Users on board!

Forums menu