Problems modifying objects

Author Message

Áncor González

Wednesday 28 April 2004 4:12:59 pm

I'm using ezPublish 3.3-3. I'm trying to write a module and I need to alter existing content object attributes. I'm using setContent function, but it doesn't work as I expected. My code:

 $objectver =& $object->currentVersion();
 $attributes =& $objectver->dataMap();
 $my_attrib =& $attributes["attribname"];
 $my_string = "foo";
 $my_attrib->setContent($my_string);
 //Here, my_attrib->content() returns "foo"
 //but data_text still containts the old value
 $my_attrib->store();
 //This update de DB with the content of data_text, so my
 //changes are ignored

What is the right way to do what I'm trying?

In addition, can anybody write an small working example of a full new content object creation from scratch (settings the attributes, etc)?

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 04:18:28
Script start
Timing: Jan 19 2025 04:18:28
Module start 'layout'
Timing: Jan 19 2025 04:18:28
Module start 'content'
Timing: Jan 19 2025 04:18:29
Module end 'content'
Timing: Jan 19 2025 04:18:29
Script end

Main resources:

Total runtime1.6844 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.1563152.6250
Module start 'layout' 0.00570.0042 741.781339.4453
Module start 'content' 0.00991.6728 781.2266400.4219
Module end 'content' 1.68270.0016 1,181.64848.1641
Script end 1.6843  1,189.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2137160.0002
Check MTime0.00150.0899160.0001
Mysql Total
Database connection0.00080.047410.0008
Mysqli_queries1.642797.5254460.0357
Looping result0.00050.0290440.0000
Template Total1.646297.720.8231
Template load0.00240.139620.0012
Template processing1.643997.595120.8219
Template load and register function0.00020.014610.0002
states
state_id_array0.00150.091910.0015
state_identifier_array0.00170.101220.0009
Override
Cache load0.00190.114970.0003
Sytem overhead
Fetch class attribute can translate value0.00060.033010.0006
Fetch class attribute name0.00070.043010.0007
XML
Image XML parsing0.00010.007910.0001
class_abstraction
Instantiating content class attribute0.00000.000310.0000
General
dbfile0.00080.0480100.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 6
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs