Direct DB modifications of attributes' values/sort keys

Author Message

Piotrek Karaś

Monday 17 December 2007 5:29:43 pm

Hello there,

I have a situation in which I would like to change some content attributes' values directly in the database, without calling core eZ Publish functions. I'm talking about integer-type values, easy to manage, and cache clearing is not really an issue functionally, these values will have to take effect periodically, when cache expires, for sorting purposes.

Should I expect any anomalies when I directly change <b>sort_key_int</b> and <b>data_int</b> fields values in the <b>ezcontentobject_attribute</b> table for this given attribute?

Greets,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Piotrek Karaś

Tuesday 18 December 2007 5:46:26 am

Well, decided to turn thoughts into code ;)
http://ez.no/developer/contribs/cronjobs/ez_child_node_priority_rotator
This extension directly touches issues that I asked about above.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

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:20:58
Script start
Timing: Jan 19 2025 00:20:58
Module start 'layout'
Timing: Jan 19 2025 00:20:58
Module start 'content'
Timing: Jan 19 2025 00:20:59
Module end 'content'
Timing: Jan 19 2025 00:20:59
Script end

Main resources:

Total runtime0.6295 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.0053 588.1563152.6563
Module start 'layout' 0.00530.0020 740.812539.4922
Module start 'content' 0.00730.6205 780.3047489.7109
Module end 'content' 0.62780.0016 1,270.015612.1250
Script end 0.6294  1,282.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5307160.0002
Check MTime0.00140.2198160.0001
Mysql Total
Database connection0.00120.187610.0012
Mysqli_queries0.587293.2919520.0113
Looping result0.00050.0829500.0000
Template Total0.599095.220.2995
Template load0.00220.349520.0011
Template processing0.596894.812120.2984
Template load and register function0.00010.012710.0001
states
state_id_array0.00110.181410.0011
state_identifier_array0.00120.192120.0006
Override
Cache load0.00180.2877140.0001
Sytem overhead
Fetch class attribute can translate value0.00060.095010.0006
Fetch class attribute name0.00090.143330.0003
XML
Image XML parsing0.00040.070510.0004
class_abstraction
Instantiating content class attribute0.00000.001440.0000
General
dbfile0.00070.1190170.0000
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
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
3content/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: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs