osb/app/Models/Product/Domain.php

69 lines
1.1 KiB
PHP
Raw Normal View History

2019-07-02 15:28:27 +10:00
<?php
namespace App\Models\Product;
2020-02-19 23:37:45 +11:00
use Illuminate\Support\Collection;
2022-02-01 16:40:46 +11:00
use App\Interfaces\ProductItem;
use App\Models\Service\Domain as ServiceDomain;
use App\Models\Supplier\Domain as SupplierDomain;
2019-07-02 15:28:27 +10:00
2022-02-01 16:40:46 +11:00
final class Domain extends Type implements ProductItem
2019-07-02 15:28:27 +10:00
{
2022-02-01 16:40:46 +11:00
protected $table = 'product_domain';
// 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()
{
2022-04-19 17:07:39 +10:00
return $this->hasOne(SupplierDomain::class,'id','supplier_item_id');
2022-02-01 16:40:46 +11:00
}
/* INTERFACES */
2020-02-19 23:37:45 +11:00
public function allowance(): Collection
{
// N/A
return collect();
}
public function allowance_string(): string
{
// N/A
return '';
}
public function getContractTermAttribute(): int
{
return 12;
}
2020-02-19 23:37:45 +11:00
public function getCostAttribute(): float
{
// N/A
return 0;
}
2020-02-20 22:54:28 +11:00
public function getSupplierAttribute()
{
return '';
}
public function getTypeAttribute()
{
return 'Domain Name';
}
public function hasUsage(): bool
{
return FALSE;
}
2019-07-02 15:28:27 +10:00
}