2022-04-02 07:06:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Product;
|
|
|
|
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
|
|
|
use App\Interfaces\ProductItem;
|
|
|
|
use App\Models\Service\Email as ServiceEmail;
|
|
|
|
use App\Models\Supplier\Email as SupplierEmail;
|
|
|
|
|
|
|
|
final class Email extends Type implements ProductItem
|
|
|
|
{
|
|
|
|
protected $table = 'product_email';
|
|
|
|
|
2022-06-12 01:21:20 +00:00
|
|
|
protected const category_name = 'Email Hosting';
|
|
|
|
|
2022-04-02 07:06:34 +00:00
|
|
|
// The model that is referenced when this product is ordered
|
|
|
|
protected string $order_model = ServiceEmail::class;
|
|
|
|
|
|
|
|
/* RELATIONS */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The offering supplied with this product
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
|
|
*/
|
|
|
|
public function supplied()
|
|
|
|
{
|
2022-04-19 07:07:39 +00:00
|
|
|
return $this->hasOne(SupplierEmail::class,'id','supplier_item_id');
|
2022-04-02 07:06:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
}
|