Friday 09 May 2003 8:40:36 am
Ok, so I have:
----------
$class =& eZContentClass::fetch( 28 );
// Create object by userid in sectionid $contentObject =& $class->instantiate( $userID, $sectionID );
$nodeAssignment =& eZNodeAssignment::create( array(
'contentobject_id' => $contentObject->attribute( 'id' ),
'contentobject_version' => $contentObject->attribute( 'current_version' ),
'parent_node' => 1,
'is_main' => 1
) );
$version =& $contentObject->version( 1 ); $contentObjectAttributes =& $version->contentObjectAttributes();
$contentObjectAttributes[0]->setContent( $structure->headers['from'] ); $contentObjectAttributes[0]->store();
$version->setAttribute( 'modified', eZDateTime::currentTimeStamp() );
$version->setAttribute( 'status', EZ_VERSION_STATUS_DRAFT ); $version->setAttribute( 'name', $name );
$version->store();
$contentObject->store(); $nodeAssignment->store(); $operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObject->attribute( 'id' ), 'version' => 1 ) ); ---------- But it doesn't quite work. I'd figure that the content object should be turning up in the root node but it won't (but it DOES get added to the db)
Visit http://triligon.org
|