osb/app/Models/Product/Domain.php

66 lines
1.1 KiB
PHP

<?php
namespace App\Models\Product;
use Illuminate\Support\Collection;
use App\Interfaces\ProductItem;
use App\Models\Service\Domain as ServiceDomain;
use App\Models\Supplier\Domain as SupplierDomain;
final class Domain extends Type implements ProductItem
{
protected $table = 'product_domain';
protected const category_name = 'Domain Name';
// The model that is referenced when this product is ordered
protected string $order_model = ServiceDomain::class;
/* RELATIONS */
/**
* The offering supplied with this product
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function supplied()
{
return $this->hasOne(SupplierDomain::class,'id','supplier_item_id');
}
/* INTERFACES */
public function allowance(): Collection
{
// N/A
return collect();
}
public function allowance_string(): string
{
// N/A
return '';
}
public function getContractTermAttribute(): int
{
return 12;
}
public function getCostAttribute(): float
{
// N/A
return 0;
}
public function getSupplierAttribute()
{
return '';
}
public function hasUsage(): bool
{
return FALSE;
}
}