src/Cms/DomainBundle/Entity/Apex.php line 24

Open in your IDE?
  1. <?php
  2. namespace Cms\DomainBundle\Entity;
  3. use Cms\DomainBundle\Entity\Embeddables\ApexVerificationEmbeddable;
  4. use Cms\DomainBundle\Model\Dns\DomainHostInterface;
  5. use Cms\DomainBundle\Model\Dns\LookupTrait;
  6. use Cms\TenantBundle\Entity\TenantedEntity;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * Class Apex
  11.  * @package Cms\DomainBundle\Entity
  12.  *
  13.  * @ORM\Entity(
  14.  *     repositoryClass = "Cms\DomainBundle\Doctrine\ApexRepository"
  15.  * )
  16.  *
  17.  * @ORM\Table(
  18.  *     name = "cms__domain__apex"
  19.  * )
  20.  */
  21. class Apex extends TenantedEntity implements DomainHostInterface
  22. {
  23.     use LookupTrait;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(
  28.      *     type = "string",
  29.      *     nullable = false
  30.      * )
  31.      */
  32.     protected $host;
  33.     /**
  34.      * @var ArrayCollection
  35.      *
  36.      * @ORM\OneToMany(
  37.      *     targetEntity = "Domain",
  38.      *     mappedBy="apex"
  39.      * )
  40.      */
  41.     protected $domains;
  42.     /**
  43.      * @var ApexVerificationEmbeddable
  44.      *
  45.      * @ORM\Embedded(
  46.      *     class = "Cms\DomainBundle\Entity\Embeddables\ApexVerificationEmbeddable",
  47.      *     columnPrefix = "verification_"
  48.      * )
  49.      */
  50.     protected $verification;
  51.     /**
  52.      * {@inheritdoc}
  53.      */
  54.     public function __construct()
  55.     {
  56.         $this->verification = new ApexVerificationEmbeddable();
  57.         $this->domains = new ArrayCollection();
  58.     }
  59.     /**
  60.      * @return string
  61.      */
  62.     public function getHost(): string
  63.     {
  64.         return $this->host;
  65.     }
  66.     /**
  67.      * @param string $value
  68.      * @return $this
  69.      */
  70.     public function setHost($value)
  71.     {
  72.         $this->host $value;
  73.         return $this;
  74.     }
  75.     /**
  76.      * @return ApexVerificationEmbeddable
  77.      */
  78.     public function getVerification()
  79.     {
  80.         return $this->verification;
  81.     }
  82.     /**
  83.      * @return bool
  84.      */
  85.     public function isVerified()
  86.     {
  87.         return ( ! empty($this->getVerification()->isVerified()));
  88.     }
  89.     /**
  90.      * @return ArrayCollection
  91.      */
  92.     public function getDomains()
  93.     {
  94.         return $this->domains;
  95.     }
  96. }