osb/app/Models/ServiceSsl.php

40 lines
622 B
PHP
Raw Normal View History

2018-05-20 12:53:14 +00:00
<?php
namespace App\Models;
2018-07-16 05:06:43 +00:00
use App\Models\Service_Model as Model;
use App\Classes\SSL;
2018-05-20 12:53:14 +00:00
class ServiceSsl extends Model
{
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 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;
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
}
}