osb/app/Models/Product/Type.php
2022-04-20 12:43:10 +10:00

29 lines
665 B
PHP

<?php
namespace App\Models\Product;
use Illuminate\Database\Eloquent\Model;
use App\Models\Product;
use App\Traits\{OrderServiceOptions,SiteID};
/**
* @todo These tables have a base_cost/setup_cost/contract_term columns - how is that different to the supplier_tables?
* @todo Ensure our terminology is consistent - we have a "cost", we "charge" clients.
*/
abstract class Type extends Model
{
use SiteID,OrderServiceOptions;
/* RELATIONS */
/**
* The product that sells this type
*
* @return \Illuminate\Database\Eloquent\Relations\MorphOne
*/
public function product()
{
return $this->morphOne(Product::class, null,'model','model_id');
}
}