<?php
namespace App;
use Illuminate\Database\Eloquent\Model;

class File extends Model
{
    protected $fillable = ['file_no','title','file_description', 'initiated_file_id','reference_number','priority','confidential','file_group_id','created_by','updated_by','office_id','closed_by','closed_date'];
    protected $table='file';

    function tapal()
    {
        return $this->hasMany('\App\Tapal','tapal_id');
    }

    function user()
    {
    	return $this->belongsTo('\App\User','created_by');
    }
    function closedby()
    {
        return $this->belongsTo('\App\User','closed_by');
    }

    function file_groupobj()
    {
    	return $this->belongsTo('\App\File_Group','file_group_id');
    }

    function documents()
    {
    	return $this->hasMany('\App\Documents','file_id');
    }

    function seat_permission()
    {
        return $this->hasMany('\App\Seat_Permission','seat_id');
    }

    function user_seat()
    {
        return $this->belongsTo('\App\User_Seat','seat_id');
    }
    function priorityobj()
    {
    	return $this->belongsTo('\App\Priority','priority');
    }
    function office()
    {
        return $this->belongsTo('\App\Office','office_id');
    }
}
