<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "team_skils".
 *
 * @property integer $id
 * @property integer $team_id
 * @property string $title
 * @property double $value
 *
 * @property Team $team
 */
class TeamSkils extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'team_skils';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['team_id', 'title', 'value'], 'required'],
            [['team_id'], 'integer'],
            [['value'], 'number'],
            [['title'], 'string', 'max' => 120]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'team_id' => Yii::t('app', 'Team ID'),
            'title' => Yii::t('app', 'Title'),
            'value' => Yii::t('app', 'Value'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTeam()
    {
        return $this->hasOne(Team::className(), ['id' => 'team_id']);
    }
}
