<?php

namespace modules\cors\models;

use Yii;
use modules\users\models\User;
/**
 * This is the model class For table "sightcheck".
 *
 * @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 $tester
 * @property int $created_at
 * @property int $updated_at
 * @property int $deleted_at
 * @property int $jobno
 * @property int $date
 * @property string $status
 * @property string $padno
 * @property string $position
 * @property string $wearsglasses
 * @property string $type
 * @property string $location
 * @property string $registration
 * @property string $registariongiven
 * @property string $result
 */
class Sightcheckbe extends  \common\models\Base {
	
	public $dates = ['date',];
	public $uniqueidentifiers = ['actid', 'relatedid', 'employee', 'tester'];
   	public $securefields = [];
  
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'sightcheck';
    }

    /**
     * {@inheritdoc}
     */
    public function rules(): array
    {
        return [
            [['id', 'created_by', 'updated_by', 'deleted_by', 'actid', 'relatedid', 'employee', 'tester', 'status', 'padno', 'position', 'wearsglasses', 'type', 'location', 'registration', 'registariongiven', 'result'], 'string'],
            [['created_at', 'updated_at', 'deleted_at', 'jobno', ], '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',
            'tester' => 'Tester',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'deleted_at' => 'Deleted At',
            'jobno' => 'Jobno',
            'date' => 'Date',
            'status' => 'Status',
            'padno' => 'Padno',
            'position' => 'Position',
            'wearsglasses' => 'Wearsglasses',
            'type' => 'Type',
            'location' => 'Location',
            'registration' => 'Registration',
            'registariongiven' => 'Registariongiven',
            'result' => 'Result',
        ];
    }
    public function getEmployeen() {
		return $this->hasOne(User::class, ['id' => 'employee']);
	}    
	public function getDriverl() {
		return $this->hasOne(User::class, ['id' => 'employee']);
	}
    public function getTestern() {
		return $this->hasOne(User::class, ['id' => 'tester']);
	}
    
}
