<?php
namespace Cms\DomainBundle\Entity;
use Cms\DomainBundle\Entity\Embeddables\ApexVerificationEmbeddable;
use Cms\DomainBundle\Model\Dns\DomainHostInterface;
use Cms\DomainBundle\Model\Dns\LookupTrait;
use Cms\TenantBundle\Entity\TenantedEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Apex
* @package Cms\DomainBundle\Entity
*
* @ORM\Entity(
* repositoryClass = "Cms\DomainBundle\Doctrine\ApexRepository"
* )
*
* @ORM\Table(
* name = "cms__domain__apex"
* )
*/
class Apex extends TenantedEntity implements DomainHostInterface
{
use LookupTrait;
/**
* @var string
*
* @ORM\Column(
* type = "string",
* nullable = false
* )
*/
protected $host;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(
* targetEntity = "Domain",
* mappedBy="apex"
* )
*/
protected $domains;
/**
* @var ApexVerificationEmbeddable
*
* @ORM\Embedded(
* class = "Cms\DomainBundle\Entity\Embeddables\ApexVerificationEmbeddable",
* columnPrefix = "verification_"
* )
*/
protected $verification;
/**
* {@inheritdoc}
*/
public function __construct()
{
$this->verification = new ApexVerificationEmbeddable();
$this->domains = new ArrayCollection();
}
/**
* @return string
*/
public function getHost(): string
{
return $this->host;
}
/**
* @param string $value
* @return $this
*/
public function setHost($value)
{
$this->host = $value;
return $this;
}
/**
* @return ApexVerificationEmbeddable
*/
public function getVerification()
{
return $this->verification;
}
/**
* @return bool
*/
public function isVerified()
{
return ( ! empty($this->getVerification()->isVerified()));
}
/**
* @return ArrayCollection
*/
public function getDomains()
{
return $this->domains;
}
}