Enum values from AR

Hello all Yii folks,

I am quite surprised as I do not find any way of fetching enum values from Mysql in an Active record class.

I found a topic on the forum here (http://www.yiiframework.com/forum/index.php?/topic/6456-handle-enum-field-from-db-with-yii/) about getting those values, but the code is quite huge for that.

Any chance to have a fetchEnumValues in a near future?



I am facing the same problem too, and I wrote workaround for it.

Is quite similar to the one you posted, just a bit more general:

	public static function enumItem($model,$attribute)






		$enum=substr($enum, $off+1, strlen($enum)-$off-2);




		return $values;


This can be used for popolate a dropDownList like that:


				ZHtml::enumItem($model, $attribute),


ZHtml is my extension of CHtml.

I hope it helps!