g_sto/plugins/romanah/gokbakja/models/Employee.php

58 lines
1.2 KiB
PHP

<?php
namespace Romanah\Gokbakja\Models;
use Model;
/**
* Model
*/
class Employee extends Model
{
use \October\Rain\Database\Traits\Validation;
use \October\Rain\Database\Traits\SoftDelete;
protected $dates = ['deleted_at'];
public $belongsTo = [
'job' => [
'Romanah\Gokbakja\Models\Job',
'key' => 'job_id'
]
];
public $hasMany = [
'machine' => [
'Romanah\Gokbakja\Models\Machine',
'key' => 'employee_id'
],
'mechanic_machine' => [
'Romanah\Gokbakja\Models\Machine',
'key' => 'mechanic_id'
],
'machine_production' => [
'Romanah\Gokbakja\Models\ProductionMachine',
'key' => 'employee_id'
],
'machine_production_mechanic' => [
'Romanah\Gokbakja\Models\ProductionMachine',
'key' => 'mechanic_id'
],
'sewer_production' => [
'Romanah\Gokbakja\Models\SewerProduction',
'key' => 'employee_id'
],
];
/**
* @var string The database table used by the model.
*/
public $table = 'romanah_gokbakja_employee';
/**
* @var array Validation rules
*/
public $rules = [];
}