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

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