<commit_before><?php

namespace common\models;

use Yii;
use yii\behaviors\BlameableBehavior;
use yii\behaviors\TimestampBehavior;
use frontend\models\User;
use common\models\Ticket;
use frontend\models\blameTrait;


/**
 * This is the model class for table "task".
 *
 * @property integer $id
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $created_by
 * @property integer $updated_by
 * @property string $title
 * @property string $description
 * @property integer $ticket_id
 * @property integer $user_id User Responsible for seeing the task is completed
 * @property integer $completed
 */
class Task extends \yii\db\ActiveRecord
{
    use blameTrait;

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

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title'], 'required'],
            [['created_at', 'updated_at', 'created_by', 'updated_by', 'ticket_id', 'user_id', 'completed'], 'integer'],
            [['title', 'description'], 'string'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
            BlameableBehavior::className(),
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'created_by' => Yii::t('app', 'Created By'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'title' => Yii::t('app', 'Title'),
            'description' => Yii::t('app', 'Description'),
            'ticket_id' => Yii::t('app', 'Ticket'),
            'user_id' => Yii::t('app', 'Responsible'),
            'completed' => Yii::t('app', 'Completed'),
        ];
    }

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

    /**
     * @return string
     */
    public function getResponsibleName() {
        return $this->getUpdatedBy()->one()->username;
    }

    /**
     * @return string
     */
    public function getResponsibleAvatar() {
        return $this->getUpdatedBy()->one()->avatarUrlColor;
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTicket() {<commit_msg>Bug Fix - Task Model<commit_after><?php

namespace common\models;

use Yii;
use yii\behaviors\BlameableBehavior;
use yii\behaviors\TimestampBehavior;
use frontend\models\User;
use common\models\Ticket;
use frontend\models\blameTrait;


/**
 * This is the model class for table "task".
 *
 * @property integer $id
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $created_by
 * @property integer $updated_by
 * @property string $title
 * @property string $description
 * @property integer $ticket_id
 * @property integer $user_id User Responsible for seeing the task is completed
 * @property integer $completed
 */
class Task extends \yii\db\ActiveRecord
{
    use blameTrait;

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

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title'], 'required'],
            [['created_at', 'updated_at', 'created_by', 'updated_by', 'ticket_id', 'user_id', 'completed'], 'integer'],
            [['title', 'description'], 'string'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
            BlameableBehavior::className(),
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'created_by' => Yii::t('app', 'Created By'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'title' => Yii::t('app', 'Title'),
            'description' => Yii::t('app', 'Description'),
            'ticket_id' => Yii::t('app', 'Ticket'),
            'user_id' => Yii::t('app', 'Responsible'),
            'completed' => Yii::t('app', 'Completed'),
        ];
    }

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

    /**
     * @return string
     */
    public function getResponsibleName() {
        return $this->getResponsible()->one()->username;
    }

    /**
     * @return string
     */
    public function getResponsibleAvatar() {
        return $this->getResponsible()->one()->avatarUrlColor;
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTicket() {
{'fraction_non_alphanumeric': 0.1651829871414441, 'fraction_numerical': 0.0, 'mean_word_length': 2.3175853018372705, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4402444', 'n_tokens_mistral': 1554, 'n_tokens_neox': 1522, 'n_words': 335}