osb/app/Models/Service/SSL.php

43 lines
674 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
use App\Traits\NextKey;
class SSL extends \App\Models\Base\ServiceType
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 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))
{
$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
}
}