Moving an object through php?

Author Message

Clemens T

Monday 10 October 2005 8:35:25 am

Heya all,
I have a user object @ position 1, now I want to move the user to another group @ position 2, I know both node_id's.. how can I make the move?
(in my own module, and in php)
Thanks,
Clemens

Bruce Morrison

Monday 10 October 2005 4:26:36 pm

Hi Clemens

Code to accomplish this can be found in kernel/content/action.php around line 199
else if ( $module->isCurrentAction( 'MoveNode' ) )

http://pubsvn.ez.no/websvn/filedetails.php?repname=nextgen&path=%2Ftrunk%2Fkernel%2Fcontent%2Faction.php&rev=13600&sc=1

In the trunk the key line appears to be:

eZContentObjectTreeNodeOperations::move( $nodeID, $selectedNodeID )

Where $nodeID is the node you want to move and $selectedNodeID is the destination.

Much of the preceeding code is checking that the permissions are in place.

The code in 3.6.1 seems to be a bit different in that much of the moving work is actually done in action.php

HTH

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Clemens T

Wednesday 26 October 2005 2:51:19 pm

Excellent job. Thanks a lot! Worked like a charm :).

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

eZ debug

Timing: Jan 18 2025 22:34:14
Script start
Timing: Jan 18 2025 22:34:14
Module start 'layout'
Timing: Jan 18 2025 22:34:14
Module start 'content'
Timing: Jan 18 2025 22:34:15
Module end 'content'
Timing: Jan 18 2025 22:34:15
Script end

Main resources:

Total runtime0.6185 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 587.9141152.6250
Module start 'layout' 0.00480.0022 740.539139.4453
Module start 'content' 0.00710.6100 779.9844532.3047
Module end 'content' 0.61710.0014 1,312.289112.1641
Script end 0.6185  1,324.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5621160.0002
Check MTime0.00140.2216160.0001
Mysql Total
Database connection0.00070.109010.0007
Mysqli_queries0.563991.1666570.0099
Looping result0.00070.1097550.0000
Template Total0.581694.020.2908
Template load0.00210.344720.0011
Template processing0.579493.682720.2897
Template load and register function0.00020.037410.0002
states
state_id_array0.00110.183810.0011
state_identifier_array0.00140.225720.0007
Override
Cache load0.00180.2923240.0001
Sytem overhead
Fetch class attribute can translate value0.00110.185020.0006
Fetch class attribute name0.00170.278740.0004
XML
Image XML parsing0.00100.154220.0005
class_abstraction
Instantiating content class attribute0.00000.001840.0000
General
dbfile0.00270.4410160.0002
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs