add skill and position
This commit is contained in:
54
common/models/Skill.php
Normal file
54
common/models/Skill.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "skill".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
*
|
||||
* @property CardSkill[] $cardSkills
|
||||
*/
|
||||
class Skill extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'skill';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['name'], 'required'],
|
||||
[['name'], 'string', 'max' => 100],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'name' => 'Name',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getCardSkills()
|
||||
{
|
||||
return $this->hasMany(CardSkill::className(), ['skill_id' => 'id']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user