/** * Get parent domain and set some properties * from alias domain. * * @param Domain $domain * * @return Domain */ public static function transformAliasDomain(Domain $domain) { if ($domain->getParent() !== null) { $parent = clone $domain->getParent(); $parent->setDomain($domain->getDomain())->setIpaddress($domain->getIpaddress())->setCertificate($domain->getCertificate()); return $parent; } return $domain; }
/** * Get Certificate * * @return Certificate */ public function getCertificate() { $certificate = null; if ($this->getSSLEnabled()) { if ($this->isSubDomain()) { $certificate = $this->subdomain->getCertificate(); } else { $certificate = $this->domain->getCertificate(); } } return $certificate; }