src/Entity/StatusColor.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * StatusColor
  8.  *
  9.  * @ORM\Table(name="status_color", uniqueConstraints={
  10.  *     @ORM\UniqueConstraint(name="status_space_business_unique", columns={"status_name", "space_id", "business_type"})
  11.  * })
  12.  * @ORM\Entity(repositoryClass="App\Repository\StatusColorRepository")
  13.  * @UniqueEntity(fields={"statusName", "space", "businessType"})
  14.  */
  15. class StatusColor
  16. {
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var string
  27.      *
  28.      * @ORM\Column(name="status_name", type="string", length=255)
  29.      * @Assert\NotBlank
  30.      */
  31.     private $statusName;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="color", type="string", length=7)
  36.      * @Assert\NotBlank
  37.      */
  38.     private $color;
  39.     /**
  40.      * @var \App\Entity\Space|null
  41.      *
  42.      * @ORM\ManyToOne(targetEntity="App\Entity\Space")
  43.      * @ORM\JoinColumn(name="space_id", referencedColumnName="id", nullable=true)
  44.      */
  45.     private $space;
  46.     /**
  47.      * @ORM\Column(name="business_type", type="string", length=50, nullable=true)
  48.      * @Assert\Choice(callback={"App\Constants\BusinessTypeSettingsCompanyConstants", "getAvailableRelatedTypes"})
  49.      */
  50.     private ?string $businessType null;
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getStatusName(): ?string
  56.     {
  57.         return $this->statusName;
  58.     }
  59.     public function setStatusName(string $statusName): self
  60.     {
  61.         $this->statusName $statusName;
  62.         return $this;
  63.     }
  64.     public function getColor(): ?string
  65.     {
  66.         return $this->color;
  67.     }
  68.     public function setColor(string $color): self
  69.     {
  70.         $this->color $color;
  71.         return $this;
  72.     }
  73.     public function getSpace(): ?Space
  74.     {
  75.         return $this->space;
  76.     }
  77.     public function setSpace(?Space $space): self
  78.     {
  79.         $this->space $space;
  80.         return $this;
  81.     }
  82.     public function getBusinessType(): ?string
  83.     {
  84.         return $this->businessType;
  85.     }
  86.     public function setBusinessType(?string $businessType): self
  87.     {
  88.         $this->businessType $businessType;
  89.         return $this;
  90.     }
  91. }