Creating a new version of a content object (in PHP)

Author Message

Tom Couwberghs

Tuesday 04 November 2003 11:46:20 pm

Hi all,

I'm using the code described in http://www.ez.no/developer/ez_publish_3/forum/developer/creating_a_simple_content_object_via_php to import external user data into custom userobjects. So far so good, al seems to be working fine.

Here's my problem: we would like eZPublish to manage different versions of these user objects because we need historical data on users frow now on. For example: we need to know what department an employee was in five years ago.

I know this can be done easily by eZP, by using version management, but I'm not sure on how to create a new version of a contentobject with PHP.

Does anybody know how to do this?

Thanks in advance,

Tom

Tom Couwberghs

Thursday 06 November 2003 2:54:28 am

Another more difficult question:

I've imported our organigram structure into eZP. We would like to keep historical data from the organigram too. For this we need to store the node placements of each objectversion as units can move in the organigram during their existance.

I did some research, and if I'm correct, then eZP just overwrites the node placement in the table eZContentObject_Tree when a new version is created.

Could anybody confirm if I'm right with this?
How would you handle this problem?

All comments and thoughts are very much appreciated.

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 19 2025 00:55:42
Script start
Timing: Jan 19 2025 00:55:42
Module start 'layout'
Timing: Jan 19 2025 00:55:42
Module start 'content'
Timing: Jan 19 2025 00:55:43
Module end 'content'
Timing: Jan 19 2025 00:55:43
Script end

Main resources:

Total runtime0.8998 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 590.5625152.6406
Module start 'layout' 0.00500.0041 743.203139.4922
Module start 'content' 0.00910.8892 782.6953460.8516
Module end 'content' 0.89830.0014 1,243.54698.1250
Script end 0.8997  1,251.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3631160.0002
Check MTime0.00130.1426160.0001
Mysql Total
Database connection0.00070.080710.0007
Mysqli_queries0.846594.0772520.0163
Looping result0.00040.0487500.0000
Template Total0.857295.320.4286
Template load0.00220.243520.0011
Template processing0.855095.025720.4275
Template load and register function0.00010.011710.0001
states
state_id_array0.00110.127410.0011
state_identifier_array0.00080.083620.0004
Override
Cache load0.00180.1994200.0001
Sytem overhead
Fetch class attribute can translate value0.00080.092210.0008
Fetch class attribute name0.00100.106930.0003
XML
Image XML parsing0.00170.188310.0017
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00720.8014160.0005
String conversion0.00000.000740.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs