private static function loadItems() { self::$_items = array(); $models = self::model()->findAll(); foreach ($models as $model) { self::$_items[$model->employee_designation_id] = $model->employee_designation_name; } }
/** * Generate array for dropdown list to use in child form. * @return array $_items */ public static function items() { self::$_items = CHtml::listData(self::model()->findAll(), 'employee_designation_id', 'employee_designation_name'); return self::$_items; }