src/Entity/DomainVariation.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DomainVariationRepository;
  4. use App\Validator\UniqueDomainPool;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=DomainVariationRepository::class)
  11.  * @ORM\Table(name="domain_variation")
  12.  * @ORM\HasLifecycleCallbacks()
  13.  * @UniqueDomainPool()
  14.  */
  15. class DomainVariation extends AbstractBaseEntity
  16. {
  17.     /**
  18.      * @ORM\Column(type="simple_array")
  19.      * @Assert\Unique(message="Duplicated domain variation")
  20.      * @Assert\Count(
  21.      *     min=1,
  22.      *     minMessage="Must have at least one domain variation"
  23.      * )
  24.      * @Assert\All(
  25.      *     @Assert\Hostname(message="Invalid domain name.")
  26.      * )
  27.      */
  28.     private array $domainPool = [];
  29.     /**
  30.      * @return array|null
  31.      */
  32.     public function getDomainPool(): ?array
  33.     {
  34.         return $this->domainPool;
  35.     }
  36.     /**
  37.      * @param array $domainPool
  38.      * @return $this
  39.      */
  40.     public function setDomainPool(array $domainPool): self
  41.     {
  42.         $this->domainPool $domainPool;
  43.         return $this;
  44.     }
  45.     /**
  46.      * constructor
  47.      */
  48.     public function __construct()
  49.     {
  50.         parent::__construct();
  51.     }
  52. }