skill category

This commit is contained in:
andrey
2021-06-08 17:05:54 +03:00
parent 9f1db817a5
commit 23773eff4e
13 changed files with 487 additions and 0 deletions

View File

@ -9,6 +9,7 @@ use Yii;
*
* @property int $id
* @property string $name
* @property integer $category_id
*
* @property CardSkill[] $cardSkills
*/
@ -29,6 +30,7 @@ class Skill extends \yii\db\ActiveRecord
{
return [
[['name'], 'required'],
[['category_id'], 'integer'],
[['name'], 'string', 'max' => 100],
];
}
@ -51,4 +53,9 @@ class Skill extends \yii\db\ActiveRecord
{
return $this->hasMany(CardSkill::className(), ['skill_id' => 'id']);
}
public function getCategory()
{
return $this->hasOne(SkillCategory::class, ['id' => 'category_id']);
}
}