generateEnumList
as the name suggests, this method ( in your AppModel ) generate a list based on the values of an enum field.
function generateEnumList($fieldName)
{
foreach($this->_tableInfo->value as $field)
{
if($field['name'] == $fieldName) {
$enum = $field['type'];
break;
}
} foreach(split("','", substr($enum, 6, -2)) as $num => $name) { $return[$name] = $name;
} return $return;
}
on June 8, 2006 on 9:46 pm
I see you liked my code 🙂
http://groups.google.com/group/cake-php/msg/550ec44d856548d4
on June 9, 2006 on 2:50 pm
hah! that’s funny, cool code then 😉