<?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 "vehiclekeys".
 *
 * @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 string $vehicle
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $deleted_at
 * @property integer $jobno
 * @property integer $peg
 * @property string $status
 * @property string $padno
 * @property string $location
 * @property string $type
 */
class Vehiclekeysbe extends \common\models\Base {
	
	public $dates = ['date'];
	public $uniqueidentifiers = ['relatedid', 'actid', 'employee', 'vehicle'];
    public $securefields = [];
   
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'vehiclekeys';
    }

    /**
     * @inheritdoc
     */
    public function rules(): array
    {
        return [
            [['id', 'created_by', 'updated_by', 'deleted_by', 'actid', 'relatedid', 'employee', 'vehicle', 'status', 'padno', 'location', 'type'], 'string'],
            [['created_at', 'updated_at', 'deleted_at', 'jobno', 'peg'], 'integer'],
            [['date'], 'safe'],
            [['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',
            'vehicle' => 'Vehicle',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'deleted_at' => 'Deleted At',
            'jobno' => 'Jobno',
            'peg' => 'Peg',
            'status' => 'Status',
            'padno' => 'Padno',
            'location' => 'Location',
            'type' => 'Type',
            'date' => 'Date',
        ];
    }
    public function getVehiclel() {
		return $this->hasOne(\modules\cors\models\Vehiclebe::class, ['id' => 'vehicle']);
	}
    public function getEmployeel() {
		return $this->hasOne(User::class, ['id' => 'employee']);
	}
    
}
