More works on products
This commit is contained in:
@@ -2,13 +2,32 @@
|
||||
|
||||
namespace App\Models\Product;
|
||||
|
||||
use App\Models\Base\ProductType;
|
||||
use App\Traits\NextKey;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class Host extends ProductType
|
||||
use App\Interfaces\ProductItem;
|
||||
use App\Models\Service\Host as ServiceHost;
|
||||
use App\Models\Supplier\Host as SupplierHost;
|
||||
|
||||
final class Host extends Type implements ProductItem
|
||||
{
|
||||
use NextKey;
|
||||
const RECORD_ID = '';
|
||||
protected $table = 'product_host';
|
||||
|
||||
// The model that is referenced when this product is ordered
|
||||
protected string $order_model = ServiceHost::class;
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
/**
|
||||
* The offering supplied with this product
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function supplied()
|
||||
{
|
||||
return $this->hasOne(SupplierHost::class,'id','supplier_host_id');
|
||||
}
|
||||
|
||||
/* INTERFACES */
|
||||
|
||||
public function getContractTermAttribute(): int
|
||||
{
|
||||
@@ -24,4 +43,24 @@ class Host extends ProductType
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
public function allowance(): Collection
|
||||
{
|
||||
// TODO: Implement allowance() method.
|
||||
}
|
||||
|
||||
public function allowance_string(): string
|
||||
{
|
||||
// TODO: Implement allowance_string() method.
|
||||
}
|
||||
|
||||
public function getCostAttribute(): float
|
||||
{
|
||||
// TODO: Implement getCostAttribute() method.
|
||||
}
|
||||
|
||||
public function getSupplierAttribute()
|
||||
{
|
||||
// TODO: Implement getSupplierAttribute() method.
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user