How to set an objects' creation date in PHP via the API?

Author Message

Rainer Krauss

Wednesday 24 June 2009 2:53:00 am

Dear all,

I intend to change the date an object was created. How would I do that, please?

Background info: I'm importing content from another site. Thanks to examples, I'm already able to change attributes in the data_map.

By the way, is there any info available on how to be using the information located at http://pubsvn.ez.no/doxygen/trunk/html/index.html ? Being fairly new to developing extensions using the API, I find that information quite confusing and overwhelming. Any help or step-by-step examples would greatly help me in becoming able to find my way around the API.

Best wishes,
Rainer

Carlos Revillo

Wednesday 24 June 2009 3:17:00 pm

Hi.
Have you tried

$object->setAttribute('published', [timestamp here]);

hope it helps.

Rainer Krauss

Thursday 25 June 2009 1:28:17 am

Yes, I did, Carlos, and it helped! Thank you!

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 03:41:32
Script start
Timing: Jan 19 2025 03:41:32
Module start 'layout'
Timing: Jan 19 2025 03:41:32
Module start 'content'
Timing: Jan 19 2025 03:41:34
Module end 'content'
Timing: Jan 19 2025 03:41:34
Script end

Main resources:

Total runtime1.2753 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 589.3984152.6563
Module start 'layout' 0.00480.0042 742.054739.4922
Module start 'content' 0.00911.2649 781.5469469.8281
Module end 'content' 1.27400.0014 1,251.37508.1094
Script end 1.2753  1,259.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2346160.0002
Check MTime0.00130.0999160.0001
Mysql Total
Database connection0.00090.070810.0009
Mysqli_queries1.234396.7826570.0217
Looping result0.00060.0452550.0000
Template Total1.223996.020.6120
Template load0.00210.165720.0011
Template processing1.221895.802020.6109
Template load and register function0.00020.017110.0002
states
state_id_array0.00180.144710.0018
state_identifier_array0.00220.172520.0011
Override
Cache load0.00170.1353160.0001
Sytem overhead
Fetch class attribute can translate value0.00090.070420.0004
Fetch class attribute name0.00100.081430.0003
XML
Image XML parsing0.00030.020220.0001
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00070.0514100.0001
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/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
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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs