47 lines
891 B
PHP
47 lines
891 B
PHP
<?php
|
|
|
|
namespace Modules\AssetExchange\Models;
|
|
|
|
use App\Business;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PipelineLink extends Model
|
|
{
|
|
protected $table = 'aex_pipeline_links';
|
|
|
|
protected $fillable = [
|
|
'business_id',
|
|
'listing_id',
|
|
'deal_id',
|
|
'stage',
|
|
'linked_type',
|
|
'linked_id',
|
|
'completed_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'linked_id' => 'integer',
|
|
'completed_at' => 'datetime',
|
|
];
|
|
|
|
public function business()
|
|
{
|
|
return $this->belongsTo(Business::class);
|
|
}
|
|
|
|
public function listing()
|
|
{
|
|
return $this->belongsTo(Listing::class, 'listing_id');
|
|
}
|
|
|
|
public function deal()
|
|
{
|
|
return $this->belongsTo(Deal::class, 'deal_id');
|
|
}
|
|
|
|
public function linked()
|
|
{
|
|
return $this->morphTo(__FUNCTION__, 'linked_type', 'linked_id');
|
|
}
|
|
}
|