<?php
namespace modules\cors\models;

use Yii;


/**
 * This is the model class For table "licensecat".
 *
 * @property string $id
 * @property integer $created_at
 * @property integer $updated_at
 * @property string $created_by
 * @property string $updated_by
 * @property string $deleted_by
 * @property integer $deleted_at
 * @property integer $deleted
 * @property string $actid
 * @property string $status
 * @property string $padno
 * @property integer $jobno
 * @property string $relatedid
 * @property string $category
 * @property integer $startdate
 * @property integer $enddate
 */
class Licensecatbe extends \common\models\Base
{
	public $dates = ['created_at', 'updated_at', 'deleted_at', 'startdate', 'enddate'];
	public $uniqueidentifiers = ['actid', 'relatedid'];
	public $securefields = [];
    
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'licensecat';
    }

    /**
     * @inheritdoc
     */
    public function rules(): array
    {
        return [
            [['id', 'created_by', 'updated_by', 'deleted_by', 'actid', 'status', 'padno', 'relatedid', 'category'], 'string'],
            [['created_at', 'updated_at', 'deleted_at', 'deleted', 'jobno'], 'integer'],
            [['startdate', 'enddate'], 'safe'],
            
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels(): array {
        return [
            'id' => 'ID',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'created_by' => 'Created By',
            'updated_by' => 'Updated By',
            'deleted_by' => 'Deleted By',
            'deleted_at' => 'Deleted At',
            'deleted' => 'Deleted',
            'actid' => 'Actid',
            'status' => 'Status',
            'padno' => 'Padno',
            'jobno' => 'Jobno',
            'relatedid' => 'Relatedid',
            'category' => 'Category',
            'startdate' => 'Startdate',
            'enddate' => 'Enddate',
        ];
    }
   
	public function getDescription() {
		return $this->hasOne(\backend\models\Licensecatsbe::class, ['id' => 'category']);
	}
	
   
}
