Sunday 01 June 2003 8:21:40 pm
I'm trying to create a new content object with a single enum attribute. I use the following code to try to create an eZEnumObjectValue to store in the attribute:
$attributes = $version->contentObjectAttributes();
$enum = $attributes[0]->content();
$enumobjectList = $enum->attribute('enumobject_list');
$enumobjectList[0] =&
eZEnumObjectValue::create(
$enum->attribute('contentclass_attributeid'),
$enum->attribute('contentclass_attributeversion'),
$ids[$Rating],
$elements[$Rating],
$values[$Rating]); $enumobjectList[0]->store(); The value appears to be stored to the database, but isn't associated with the object. The contentclass_attributeid always seems to be the id of the enum in the class definition, instead of an id specific to the instantiated object. I've tried this code both before and after publishing the object. Do I need to publish it and then fetch it to do this? Do I somehow need to create an attribute? What am I doing wrong?
|