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

49 lines
1.0 KiB
PHP

<?php namespace Romanah\Gokbakja\Models;
use Model;
/**
* Model
*/
class Machine extends Model
{
use \October\Rain\Database\Traits\Validation;
use \October\Rain\Database\Traits\SoftDelete;
protected $dates = ['deleted_at'];
public $belongsTo = [
'building' => [
'Romanah\Gokbakja\Models\Building',
'key' => 'building_id'
],
'mechanic' => [
'Romanah\Gokbakja\Models\Employee',
'key' => 'mechanic_id',
'conditions' => 'is_mechanic = 1'
],
'employee' => [
'Romanah\Gokbakja\Models\Employee',
'key' => 'employee_id'
],
];
public $hasMany = [
'machine_production' => [
'Romanah\Gokbakja\Models\ProductionMachine',
'key' => 'machine_id'
]
];
/**
* @var string The database table used by the model.
*/
public $table = 'romanah_gokbakja_machine';
/**
* @var array Validation rules
*/
public $rules = [
];
}