<?php

namespace modules\cors\models;


use Yii;
use modules\users\models\User;
/**
 * This is the model class For table "finesandcharges".
 *
 * @property string $id
 * @property string $created_by
 * @property string $updated_by
 * @property string $deleted_by
 * @property string $actid
 * @property string $relatedid
 * @property string $uniqueidentifier
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $deleted_at
 * @property integer $jobno
 * @property integer $date
 * @property integer $penalypointsissued
 * @property string $status
 * @property string $padno
 * @property string $issuingbody
 * @property string $reference
 * @property string $location
 * @property string $reason
 * @property integer $penaltypoints
 * @property string $value
 */
class Finesandchargesbe extends \common\models\Base
{
	public $dates = ['date'];
	public $uniqueidentifiers = ['actid', 'relatedid', 'employee'];
    public $securefields = [];
   
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'finesandcharges';
    }

    /**
     * @inheritdoc
     */
    public function rules(): array
    {
        return [
            [['id', 'created_by', 'updated_by', 'deleted_by', 'actid', 'relatedid', 'employee', 'status', 'padno', 'issuingbody', 'reference', 'location', 'reason'], 'string'],
            [['created_at', 'updated_at', 'deleted_at', 'jobno', 'penalypointsissued', 'penaltypoints'], 'integer'],
            [['date'], 'safe'],
            [['value'], 'number'],
            [['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',
            'penalypointsissued' => 'Penalypointsissued',
            'status' => 'Status',
            'padno' => 'Padno',
            'issuingbody' => 'Issuingbody',
            'reference' => 'Reference',
            'location' => 'Location',
            'reason' => 'Reason',
            'penaltypoints' => 'Penaltypoints',
            'value' => 'Value',
        ];
    }
    public function getEmployeen() {
		return $this->hasOne(User::class, ['id' => 'employee']);
	}
    public function getFiles() {
		return $this->hasMany(\backend\models\Uploadsbe::class, ['relatedid' => 'id']);
	}
}
