<?php

namespace frontend\models;

use Yii;

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

    /**
     * @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']);
    }

    /**
     * @inheritdoc
     * @return TeamInterestsQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new TeamInterestsQuery(get_called_class());
    }
}
