OK. I have updated the code to use the internal description instead of
using a custom query:
function generateDifficultyList() {
foreach($this->_tableInfo->value AS $field) {
if($field['name'] == 'difficulty') {
$enum = $field['type'];
break;
}
}
foreach(split("','", substr($enum, 6, -2)) AS $num => $name)
$return[$name] = $name;
return $return;
}
I know, it uses a private variable but it is a Model private variable
and I'm using it inside the Model so I don't see any problem :-P.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---