<?php

namespace modules\cors\models;


use Yii;
use yii\behaviors\BlameableBehavior;
use yii\behaviors\TimestampBehavior;
use modules\users\models\User;
/**
 * This is the model class For table "licensechecks".
 *
 * @property string $id
 * @property string $created_by
 * @property string $updated_by
 * @property string $deleted_by
 * @property string $actid
 * @property string $relatedid
 * @property string $employee
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $deleted_at
 * @property integer $jobno
 * @property integer $date
 * @property integer $currentpoints
 * @property string $status
 * @property string $padno
 * @property string $sharedkey
 * @property string $details
 * @property integer $amendmentsneeded
 */
class Licensechecksbe extends \common\models\Base {
	
    public $dates = ['created_at', 'updated_at', 'deleted_at', 'date'];
	public $uniqueidentifiers = ['actid', 'relatedid','employee'];
	public $securefields = [];
	public $keysubmitted;
   
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'licensechecks';
    }

    /**
     * @inheritdoc
     */
    public function rules(): array
    {
        return [
            [['id', 'created_by', 'updated_by', 'deleted_by', 'actid', 'relatedid', 'employee', 'status', 'padno', 'sharedkey', 'details'], 'string'],
            [['jobno', 'currentpoints', 'amendmentsneeded'], 'integer'],
            [['created_at', 'updated_at', 'deleted_at'],'safe'],
            [['date'], 'safe'],
            [['keysubmitted'], 'boolean'],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels(): array
    {
        return [
            'id' => 'ID',
            'created_by' => 'Created By',
            'updated_by' => 'Updated By',
            'deleted_by' => 'Deleted By',
            'actid' => 'Actid',
            'relatedid' => 'Relatedid',
            'employee' => 'Employee',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'deleted_at' => 'Deleted At',
            'jobno' => 'Jobno',
            'date' => 'Date',
            'currentpoints' => 'Currentpoints',
            'status' => 'Status',
            'padno' => 'Padno',
            'sharedkey' => 'Sharedkey',
            'details' => 'Details',
            'amendmentsneeded' => 'Amendmentsneeded',
        ];
    }
    
    public function getEmployeel() {
		return $this->hasOne(User::class, ['id'=>'employee']);
	}
    
}
