Updating an attribute in an eZ Content Object

Author Message

Jim Thaxton

Monday 22 December 2008 2:27:43 pm

I am working on a calendar where we fetch the calendar events for the month. Some of these events repeat based on rules set in the Calendar Event object class. I have logic to determine the repeating rules in the template, but I would love to add these new objects to my original fetch if at all possible.

I get a fetch result $events. For the repeating items, I want to update their event date based on the repeat rules and append this repeating item to the $events result.

Is it possible to update an attribute (in this case an eZ Date attribute)? Or would I be better off to create a new array with the data I need based on the fetch for display purposes?

When I try to update the attributes in the template like so:

 {set $event.data_map.start_dt.content.timestamp= $dts['dts']

where $dts['dts'] returns a valid timestamp, I get this error so I am clearly doing this incorectly:

Empty variable name at [.data_map.start_dt.content.timestamp = $dts['dts']

Any ideas on how I should proceed?

Web Developer
Coupon Cabin
Chicago, IL

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 31 2025 01:23:54
Script start
Timing: Jan 31 2025 01:23:54
Module start 'layout'
Timing: Jan 31 2025 01:23:54
Module start 'content'
Timing: Jan 31 2025 01:23:54
Module end 'content'
Timing: Jan 31 2025 01:23:54
Script end

Main resources:

Total runtime0.0233 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.2656151.2266
Module start 'layout' 0.00530.0041 739.4922220.7188
Module start 'content' 0.00940.0125 960.2109993.7578
Module end 'content' 0.02190.0014 1,953.968829.9922
Script end 0.0233  1,983.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003113.2781140.0002
Check MTime0.00114.7698140.0001
Mysql Total
Database connection0.00083.605510.0008
Mysqli_queries0.002410.098230.0008
Looping result0.00000.103310.0000
Template Total0.00104.310.0010
Template load0.00083.432610.0008
Template processing0.00020.846110.0002
Override
Cache load0.00062.390010.0006
General
dbfile0.00156.505080.0002
String conversion0.00000.040940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs