osb/app/Models/Service/SSL.php

49 lines
824 B
PHP
Raw Normal View History

2018-05-20 12:53:14 +00:00
<?php
namespace App\Models\Service;
2018-05-20 12:53:14 +00:00
2020-02-20 11:54:28 +00:00
use App\Interfaces\ServiceItem;
use App\Models\Base\ServiceType;
use App\Traits\NextKey;
2020-02-20 11:54:28 +00:00
class SSL extends ServiceType implements ServiceItem
2018-05-20 12:53:14 +00:00
{
use NextKey;
const RECORD_ID = 'service__ssl';
2018-05-20 12:53:14 +00:00
protected $table = 'ab_service__ssl';
2018-07-16 05:06:43 +00:00
protected $_o = NULL;
2018-05-20 12:53:14 +00:00
2018-07-16 05:06:43 +00:00
public function getSSLAttribute()
2018-05-20 12:53:14 +00:00
{
2020-02-20 11:54:28 +00:00
if (is_null($this->_o)) {
$this->_o = new \App\Classes\SSL;
2018-07-16 05:06:43 +00:00
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;
2018-05-20 12:53:14 +00:00
}
2020-02-20 11:54:28 +00:00
public function getServiceDescriptionAttribute(): string
{
return $this->ssl->dn;
}
public function getServiceNameAttribute(): string
2018-05-20 12:53:14 +00:00
{
2018-07-16 05:06:43 +00:00
return $this->ssl->cn;
2018-05-20 12:53:14 +00:00
}
2020-02-20 11:54:28 +00:00
public function inContract(): bool
{
// N/A
return FALSE;
}
2018-05-20 12:53:14 +00:00
}