public function rules() { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array(array('object_id, term_id', 'length', 'max' => 20), array('object_id, term_id', 'safe', 'on' => 'search')); }