ispt4.0_laravel/app/Models/EquipmentWorkHistory.php
ygbanzato bb45616797 adding a comment system to the elementary tasks, and adding a new state when the task is completed,
updating of tasks TE7 and TE14, improvements to the equipment portfolio for technicians
2024-08-27 12:58:06 +01:00

50 lines
1.4 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EquipmentWorkHistory extends Model
{
use HasFactory;
public $timestamps = false;
protected $table = 'equipment_work_historys';
protected $primaryKey = 'equipmentWorkHistorys_id';
protected $fillable = ['equipmentWorkHistorys_id', 'equipment_id', 'ispt_number','company_projects_id','equipment_status_project'];
public function equipment()
{
return $this->belongsTo(Equipment::class, 'equipment_id', 'equipment_id');
}
public function companyProject()
{
return $this->belongsTo(CompanyProject::class, 'company_projects_id', 'company_projects_id');
}
public function controlEquipmentWorkstation()
{
return $this->hasMany(ControlEquipmentWorkstation::class, 'equipmentWorkHistorys_id', 'equipmentWorkHistorys_id');
}
public function taskEquipmentComment()
{
return $this->hasMany(TaskEquipmentComment::class, 'equipmentWorkHistorys_id', 'equipmentWorkHistorys_id');
}
public function equipmentAssociationAmbit()
{
return $this->hasOne(EquipmentAssociationAmbit::class, 'equipmentWorkHistorys_id', 'equipmentWorkHistorys_id');
}
public function HistoryOfEquipmentAmbitsInTheProject (){
return $this->hasMany(HistoryOfEquipmentAmbitsInTheProject::class, 'ambits_id', 'ambits_id');
}
}