src/Entity/Claim.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Enum\ClaimStateEnum;
  4. use App\Repository\ClaimRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ClaimRepository::class)
  9.  */
  10. class Claim
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private int $id;
  18.     /**
  19.      * @ORM\Column(type="datetime_immutable")
  20.      * @Gedmo\Timestampable(on="create")
  21.      */
  22.     private $createdAt;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=User::class)
  25.      * @ORM\JoinColumn(nullable=false)
  26.      * @Gedmo\Blameable(on="create")
  27.      */
  28.     private $author;
  29.     /**
  30.      * @ORM\OneToOne(targetEntity=ProspectOnStore::class, mappedBy="claim")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private $prospectOnStore;
  34.     /**
  35.      * @ORM\Column(type="string", length=5)
  36.      */
  37.     private $state=ClaimStateEnum::NEW;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $message;
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getCreatedAt(): ?\DateTimeImmutable
  47.     {
  48.         return $this->createdAt;
  49.     }
  50.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  51.     {
  52.         $this->createdAt $createdAt;
  53.         return $this;
  54.     }
  55.     public function getAuthor(): ?User
  56.     {
  57.         return $this->author;
  58.     }
  59.     public function setAuthor(?User $author): self
  60.     {
  61.         $this->author $author;
  62.         return $this;
  63.     }
  64.     public function getProspectOnStore(): ?ProspectOnStore
  65.     {
  66.         return $this->prospectOnStore;
  67.     }
  68.     public function setProspectOnStore(ProspectOnStore $prospectOnStore): self
  69.     {
  70.         $this->prospectOnStore $prospectOnStore;
  71.         $prospectOnStore->setClaim($this);
  72.         return $this;
  73.     }
  74.     public function getState(): ?string
  75.     {
  76.         return $this->state;
  77.     }
  78.     public function getStateLabel(): ?string
  79.     {
  80.         return ClaimStateEnum::getStateName($this->state);
  81.     }
  82.     public function setState(string $state): self
  83.     {
  84.         $this->state $state;
  85.         return $this;
  86.     }
  87.     public function getMessage(): ?string
  88.     {
  89.         return $this->message;
  90.     }
  91.     public function setMessage(string $message): self
  92.     {
  93.         $this->message $message;
  94.         return $this;
  95.     }
  96. }