osb/app/Models/Service/SSL.php
2020-02-20 22:54:28 +11:00

49 lines
824 B
PHP

<?php
namespace App\Models\Service;
use App\Interfaces\ServiceItem;
use App\Models\Base\ServiceType;
use App\Traits\NextKey;
class SSL extends ServiceType implements ServiceItem
{
use NextKey;
const RECORD_ID = 'service__ssl';
protected $table = 'ab_service__ssl';
protected $_o = NULL;
public function getSSLAttribute()
{
if (is_null($this->_o)) {
$this->_o = new \App\Classes\SSL;
if ($this->cert)
$this->_o->crt($this->cert);
if ($this->csr)
$this->_o->csr($this->csr);
if ($this->pk)
$this->_o->key($this->pk);
}
return $this->_o;
}
public function getServiceDescriptionAttribute(): string
{
return $this->ssl->dn;
}
public function getServiceNameAttribute(): string
{
return $this->ssl->cn;
}
public function inContract(): bool
{
// N/A
return FALSE;
}
}