Skip to content

Commit

Permalink
Add property res to polls answers model, also include it in rules
Browse files Browse the repository at this point in the history
  • Loading branch information
heckslay committed Nov 30, 2017
1 parent 1d430d3 commit e9bda54
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions models/PollsAnswers.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class PollsAnswers extends \yii\db\ActiveRecord
{

public $res;
/**
* @inheritdoc
*
Expand All @@ -33,7 +34,7 @@ public static function tableName()
public function rules()
{
return [
[['id_poll', 'deleted_at'], 'integer'],
[['id_poll', 'deleted_at','res'], 'integer'],
[['answer'], 'required'],
[['answer'], 'string'],
[['id_poll'], 'exist', 'skipOnError' => true, 'targetClass' => Polls::className(), 'targetAttribute' => ['id_poll' => 'id']],
Expand All @@ -47,7 +48,7 @@ public function attributeLabels()
{
return [
'id' => Yii::t('polls', '№ answer'),
'id_poll' => Yii::t('polls', ' poll'),
'id_poll' => Yii::t('polls', '# poll'),
'answer' => Yii::t('polls', 'Answer'),
];
}
Expand Down

0 comments on commit e9bda54

Please sign in to comment.