56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class LineRevision extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'ie_line_revisions';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'approved_at' => 'datetime',
|
|
'released_at' => 'datetime',
|
|
'effective_from' => 'date',
|
|
'effective_to' => 'date',
|
|
'configuration_options' => 'array',
|
|
];
|
|
|
|
public function lineTemplate()
|
|
{
|
|
return $this->belongsTo(LineTemplate::class, 'line_template_id');
|
|
}
|
|
|
|
public function boms()
|
|
{
|
|
return $this->hasMany(Bom::class, 'line_revision_id');
|
|
}
|
|
|
|
public function routingOperations()
|
|
{
|
|
return $this->hasMany(RoutingOperation::class, 'line_revision_id');
|
|
}
|
|
|
|
public function costScenarios()
|
|
{
|
|
return $this->hasMany(CostScenario::class, 'line_revision_id');
|
|
}
|
|
|
|
public function releasePackages()
|
|
{
|
|
return $this->hasMany(ReleasePackage::class, 'line_revision_id');
|
|
}
|
|
|
|
public function approvedBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'approved_by');
|
|
}
|
|
}
|