İlk temizlik tamamlandı bir önceki projeden
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Joint extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'pdfm_joints';
|
||||
|
||||
protected $fillable = [
|
||||
'joint_no',
|
||||
'spool_no',
|
||||
'element_from',
|
||||
'element_to',
|
||||
'joint_type',
|
||||
'welding_type',
|
||||
'classification',
|
||||
'status'
|
||||
];
|
||||
|
||||
// Relationships
|
||||
public function spool()
|
||||
{
|
||||
return $this->belongsTo(Spool::class, 'spool_no', 'spool_no');
|
||||
}
|
||||
|
||||
public function elementFrom()
|
||||
{
|
||||
return $this->belongsTo(Element::class, 'element_from', 'element_code');
|
||||
}
|
||||
|
||||
public function elementTo()
|
||||
{
|
||||
return $this->belongsTo(Element::class, 'element_to', 'element_code');
|
||||
}
|
||||
|
||||
public function welderAssignments()
|
||||
{
|
||||
return $this->hasMany(WelderAssignment::class, 'joint_no', 'joint_no');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user