adding forgotten files

This commit is contained in:
iIronside
2021-10-22 17:02:28 +03:00
parent 2882b8767c
commit e362ad45a4
84 changed files with 21267 additions and 0 deletions

View File

@ -0,0 +1,66 @@
<?php
namespace common\models;
use Yii;
use yii\behaviors\SluggableBehavior;
/**
* This is the model class for table "question_type".
*
* @property int $id
* @property string $question_type
* @property string $slug
*
* @property Question[] $questions
*/
class QuestionType extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'question_type';
}
public function behaviors()
{
return [
[
'class' => SluggableBehavior::class,
'attribute' => 'question_type',
]
];
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['question_type'], 'string', 'max' => 255],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'question_type' => 'Тип вопроса',
'slug' => 'Slug',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getQuestions()
{
return $this->hasMany(Question::className(), ['question_type_id' => 'id']);
}
}