skill category
This commit is contained in:
@ -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']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user