0

I have model class like this

/**
 * @property integer $is_active
 */
class User extends CActiveRecord {
....
}

$User = User::model()->findByPk(1);

In mysql is_active is always return 1 or 0, i want whenever i call $User->is_active.
It will output boolean not integer.
How to do that behavior?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
GusDeCooL
  • 5,639
  • 17
  • 68
  • 102

1 Answers1

0

Change your field to a TinyInt and yii will handle it accordingly

acorncom
  • 5,975
  • 1
  • 19
  • 31