php: change enum value

Author Message

Sebastian Sprenger

Thursday 19 February 2004 1:36:18 am

Hi all,
any idea how to change an enum value via php?
I can read the value, but I have no idea how to change it...

Thanks,
Sebastian

Bård Farstad

Thursday 19 February 2004 1:43:07 am

It's actually a bit compicated to change the enum values of enum. I would recommend using the ezselection datatype which is a new, simplified and faster implementation of this datatype.

In terms of performance ezselection is also highly recommended.

-bård

Documentation: http://ez.no/doc

Sebastian Sprenger

Thursday 19 February 2004 2:59:41 am

Sounds good, but I still don't know how to change the value.
I suppose it is
$selection->setContent()
but what kind of parameter do I have to use? Array? I want to select e.g. the second entry.
Thanks,
Sebastian

Bård Farstad

Thursday 19 February 2004 3:06:15 am

In the ezselection datatype we just store the id's of the selections in the data_text field as a string. If you have multiple values you need to use a - character as a space. E.g. "1-3" where the id's 1 and 3 are selected.

This can done with the setAttribute( 'data_text', '1-3' );

--bård

Documentation: http://ez.no/doc

Sebastian Sprenger

Thursday 19 February 2004 4:24:35 am

Oh, yes. Quite simple, it works. Thanks!

liu spider

Thursday 19 February 2004 8:26:43 pm

Could you tell me how I can delete an option in an eZSelection attribute when editing the class in the Admin?

I just can not figure it out.

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

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

Main resources:

Total runtime0.7540 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 587.8906152.6094
Module start 'layout' 0.00530.0038 740.500039.4141
Module start 'content' 0.00910.7434 779.9141604.4688
Module end 'content' 0.75250.0014 1,384.382812.1875
Script end 0.7539  1,396.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4365160.0002
Check MTime0.00140.1829160.0001
Mysql Total
Database connection0.00070.095710.0007
Mysqli_queries0.695092.1794680.0102
Looping result0.00070.0958660.0000
Template Total0.720295.520.3601
Template load0.00210.279820.0011
Template processing0.718095.233920.3590
Template load and register function0.00020.032010.0002
states
state_id_array0.00130.178510.0013
state_identifier_array0.00080.101720.0004
Override
Cache load0.00180.2439310.0001
Sytem overhead
Fetch class attribute can translate value0.00070.097530.0002
Fetch class attribute name0.00150.200980.0002
XML
Image XML parsing0.00130.167130.0004
class_abstraction
Instantiating content class attribute0.00000.002790.0000
General
dbfile0.00110.1463230.0000
String conversion0.00000.001040.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs