<?php

namespace common\modules\support\models\redmine;

use Yii;

/**
 * This is the model class for table "issue_statuses".
 *
 * @property integer $id
 * @property string $name
 * @property integer $is_closed
 * @property integer $position
 * @property integer $default_done_ratio
 * @property string $status_custumer_name
 * @property integer $status_custumer_edit
 * @property integer $send_mesage_to_customer
 * @property integer $send_mesage_to_manager
 * @property integer $send_mesage_to_developer
 * @property integer $closed_manager
 * @property integer $closed_developer
 * @property string $status_developer_name
 * @property integer $watch_by_developer
 * @property integer $watch_by_manager
 * @property integer $watch_by_customer
 * @property integer $status
 */
class IssueStatus extends \common\components\ActiveRecordModel
{
    /**
     * @inheritdoc
     */
    public function name() 
    {
        return 'Статус задач Redmine';
    }

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'issue_statuses';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('dbSupport');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['is_closed', 'position', 'default_done_ratio', 'status_custumer_edit', 'send_mesage_to_customer', 'send_mesage_to_manager', 'send_mesage_to_developer', 'closed_manager', 'closed_developer', 'watch_by_developer', 'watch_by_manager', 'watch_by_customer', 'status'], 'integer'],
            [['name'], 'string', 'max' => 30],
            [['status_custumer_name', 'status_developer_name'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'is_closed' => 'Is Closed',
            'position' => 'Position',
            'default_done_ratio' => 'Default Done Ratio',
            'status_custumer_name' => 'Status Custumer Name',
            'status_custumer_edit' => 'Status Custumer Edit',
            'send_mesage_to_customer' => 'Send Mesage To Customer',
            'send_mesage_to_manager' => 'Send Mesage To Manager',
            'send_mesage_to_developer' => 'Send Mesage To Developer',
            'closed_manager' => 'Closed Manager',
            'closed_developer' => 'Closed Developer',
            'status_developer_name' => 'Status Developer Name',
            'watch_by_developer' => 'Watch By Developer',
            'watch_by_manager' => 'Watch By Manager',
            'watch_by_customer' => 'Watch By Customer',
            'status' => 'Status',
        ];
    }
}
