<?php namespace Romanah\Gokbakja\Models;

use Model;

/**
 * Model
 */
class SewerProduction extends Model
{
    use \October\Rain\Database\Traits\Validation;

    use \October\Rain\Database\Traits\SoftDelete;

    protected $dates = ['deleted_at'];

    public $hasMany = [
        'pivot_sewer' => [
            'Romanah\Gokbakja\Models\PivotSewer',
            'key' => 'sewer_production_id',
            'softDelete' => true
        ]
    ];

    public $hasOne = [
        'pivot_sewer_lst' => [
            'Romanah\Gokbakja\Models\PivotSewer',
            'key' => 'sewer_production_id',
        ]
    ];

    public $belongsTo = [
        'employee' => [
            'Romanah\Gokbakja\Models\Employee',
            'key' => 'employee_id'
        ],
        'rulon_action' => [
            'Romanah\Gokbakja\Models\RulonAction',
            'key' => 'rulon_action_id'
        ],
        'shift' => [
            'Romanah\Gokbakja\Models\Shift',
            'key' => 'shift_id'
        ],
        'sewer_machine' => [
            'Romanah\Gokbakja\Models\SewerMachine',
            'key' => 'sewer_machine_id'
        ],
        'color' => [
            'Romanah\Gokbakja\Models\BagColor',
            'key' => 'color_id'
        ],
    ];

    /**
     * @var string The database table used by the model.
     */
    public $table = 'romanah_gokbakja_sewer_production';

    /**
     * @var array Validation rules
     */
    public $rules = [
    ];
}
