eZ Community » Forums » Developer » php: change enum value
expandshrink

php: change enum value

php: change enum value

Thursday 19 February 2004 10:36:18 am - 5 replies

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

Thursday 19 February 2004 10: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

Thursday 19 February 2004 11: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

Thursday 19 February 2004 12:06:15 pm

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

Thursday 19 February 2004 1:24:35 pm

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

Friday 20 February 2004 5:26:43 am

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.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu