Using morphTo() on services, added Ezypay payment Import
This commit is contained in:
37
app/Models/Service/SSL.php
Normal file
37
app/Models/Service/SSL.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
class SSL extends \App\Models\Base\ServiceType
|
||||
{
|
||||
protected $table = 'ab_service__ssl';
|
||||
protected $_o = NULL;
|
||||
|
||||
public function tld()
|
||||
{
|
||||
return $this->belongsTo(DomainTld::class,'domain_tld_id');
|
||||
}
|
||||
|
||||
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 getNameAttribute()
|
||||
{
|
||||
return $this->ssl->cn;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user