Forums / Developer / Changing an enum's value

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Changing an enum's value

Author Message

Rib Rdb

Sunday 01 June 2003 10:20:42 pm

Now that I created an enum value, I'm having problems trying to edit it. Here's the code I'm using:
$attribute = $dataMap['rating'];
$enum = $attribute->attribute('content');
$enumobjectList = $enum->attribute('enumobject_list');
$enumObjValue = $enumobjectList[0];
$enumObjValue->setAttribute('enumelement', $elements[$Rating]);
$enumObjValue->setAttribute('enumvalue',$values[$Rating]);
$enumObjValue->setAttribute('enumid',$ids[$Rating]);
$enumObjValue->store();

Instead of changing the existing value, it creates a new one. If I don't want to bother with versions (I don't care about the old value and don't need it cluttering the database) do I need to remove the old value and then create a new one?