2018-05-20 12:53:14 +00:00
|
|
|
<?php
|
|
|
|
|
2019-06-07 06:54:27 +00:00
|
|
|
namespace App\Models\Service;
|
2018-05-20 12:53:14 +00:00
|
|
|
|
2019-06-13 04:32:34 +00:00
|
|
|
use App\Traits\NextKey;
|
|
|
|
|
2019-06-07 06:54:27 +00:00
|
|
|
class SSL extends \App\Models\Base\ServiceType
|
2018-05-20 12:53:14 +00:00
|
|
|
{
|
2019-06-13 04:32:34 +00:00
|
|
|
use NextKey;
|
|
|
|
const RECORD_ID = 'service__ssl';
|
|
|
|
|
2018-05-20 12:53:14 +00:00
|
|
|
protected $table = 'ab_service__ssl';
|
2019-06-13 04:32:34 +00:00
|
|
|
|
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 tld()
|
2018-05-20 12:53:14 +00:00
|
|
|
{
|
2018-07-16 05:06:43 +00:00
|
|
|
return $this->belongsTo(DomainTld::class,'domain_tld_id');
|
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
|
|
|
{
|
2018-07-16 05:06:43 +00:00
|
|
|
if (is_null($this->_o))
|
|
|
|
{
|
2019-06-07 06:54:27 +00:00
|
|
|
$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
|
|
|
}
|
|
|
|
|
|
|
|
public function getNameAttribute()
|
|
|
|
{
|
2018-07-16 05:06:43 +00:00
|
|
|
return $this->ssl->cn;
|
2018-05-20 12:53:14 +00:00
|
|
|
}
|
|
|
|
}
|