<?php

namespace common\modules\support\models\redmine;

use Yii;

class Issue extends yii\base\Model
{
    public $subject;
    public $project_id;
    public $priority_id = self::PRIORITY_FIRE;
    public $description;
    public $author_id;
    public $tracker_id = self::TRACKER_NONE;
    public $status_id = self::STATUS_NEW;

    const PRIORITY_SIMPLE = 2;
    const PRIORITY_FIRE = 3;

    const TRACKER_NONE = 14; // Не определено

    const STATUS_NEW = 7;

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['tracker_id', 'project_id', 'status_id', 'priority_id', 'description'], 'required'],
            [['tracker_id', 'project_id', 'status_id', 'priority_id'], 'integer'],
            [['description'], 'string'],
            [['subject'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'project_id' => 'Проект',
            'subject' => 'Заголовок задачи',
            'tracker_id' => 'Tracker ID',
            'description' => 'Текст задачи',
            'priority_id' => 'Важность',
            'status_id' => 'Статус',
        ];
    }

   
}