2019-07-02 05:28:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Product;
|
|
|
|
|
2020-02-18 11:35:20 +00:00
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
use App\Interfaces\ProductItem;
|
|
|
|
use App\Models\Service\SSL as ServiceSSL;
|
|
|
|
use App\Models\Supplier\SSL as SupplierSSL;
|
2019-07-02 05:28:27 +00:00
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
final class SSL extends Type implements ProductItem
|
2019-07-02 05:28:27 +00:00
|
|
|
{
|
2022-02-01 05:40:46 +00:00
|
|
|
protected $table = 'product_ssl';
|
2019-07-02 05:28:27 +00:00
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
// The model that is referenced when this product is ordered
|
|
|
|
protected string $order_model = ServiceSSL::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(SupplierSSL::class,'id','supplier_item_id');
|
2022-02-01 05:40:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* INTERFACES */
|
2020-02-18 11:35:20 +00:00
|
|
|
|
|
|
|
public function allowance(): Collection
|
|
|
|
{
|
|
|
|
// N/A
|
|
|
|
return collect();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function allowance_string(): string
|
|
|
|
{
|
|
|
|
// N/A
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
2021-12-24 01:14:01 +00:00
|
|
|
public function getContractTermAttribute(): int
|
|
|
|
{
|
|
|
|
return 12;
|
|
|
|
}
|
|
|
|
|
2020-02-18 11:35:20 +00:00
|
|
|
public function getCostAttribute(): float
|
|
|
|
{
|
|
|
|
// N/A
|
|
|
|
return 0;
|
|
|
|
}
|
2020-02-20 11:54:28 +00:00
|
|
|
|
|
|
|
public function getSupplierAttribute()
|
|
|
|
{
|
2022-04-19 07:07:39 +00:00
|
|
|
abort(500,'deprecated');
|
2020-02-20 11:54:28 +00:00
|
|
|
$o = new \stdClass();
|
|
|
|
$o->name = 'Internal';
|
|
|
|
|
|
|
|
return $o;
|
|
|
|
}
|
2021-12-24 01:14:01 +00:00
|
|
|
|
|
|
|
public function getTypeAttribute()
|
|
|
|
{
|
|
|
|
return 'SSL Certificate';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasUsage(): bool
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2019-07-02 05:28:27 +00:00
|
|
|
}
|