Friday 02 September 2005 2:43:11 am
Hi! After reading a lot of code in ezcontentobject.php, ezcontentobjectattribute.php, ezselectiontype.php etc. I still can't figure out how to store content in an object attribute of datatype ezselection. The attribute is set up to only store one selection (so I later can filter on it in the template). I've tried with
$attribs =& $contentObject->contentObjectAttributes();
for($k=0;$k<count($attribs);$k++)
{
switch($attribs[$k]->attribute("contentclass_attribute_identifier"))
{
case 'county':
$attribs[$k]->setAttribute('data_int', $county);
attribs[$k]->store();
break;
}
}
The $county variable conatins an integer, refering to the index in the selection datatype.
The data_int-value is stored, but I think the problem is that the value should be stored somewhere else. But where and how?
|