24 public static function model($className = __CLASS__)
49 array(
'active',
'default',
'value' => 1),
50 array(
'created',
'default',
'value' => AppHelper::mysqlDate()),
51 array(
'question_id, answer_key, text, active',
'required'),
52 array(
'order, active',
'numerical',
'integerOnly' =>
true),
53 array(
'text',
'safe'),
54 array(
'created',
'type',
'type'=>
'datetime',
'datetimeFormat' =>
'yyyy-MM-dd HH:mm:ss'),
55 array(
'id, question_id, text, order, created',
'safe',
'on'=>
'search'),
60 public function relations()
63 'question' => array(CActiveRecord::BELONGS_TO,
'Question',
'question_id'),
64 'userAnswers' => array(CActiveRecord::HAS_MANY,
'UserAnswer',
'answer_id'),
65 'userAnswersCount' => array(CActiveRecord::STAT,
'UserAnswer',
'answer_id')
68 public function getAttributeLabel($name)