src/Entity/PipelineIdentiteVisuelleMajItem.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\PipelineIdentiteVisuelleMajItemStatus;
  4. use App\Repository\PipelineIdentiteVisuelleMajItemRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassPipelineIdentiteVisuelleMajItemRepository::class)]
  9. class PipelineIdentiteVisuelleMajItem
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private ?int $id null;
  15.     #[ORM\ManyToOne(targetEntityPipelineIdentiteVisuelleMaj::class, inversedBy'items')]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?PipelineIdentiteVisuelleMaj $pipeline null;
  18.     #[ORM\Column(type'string'length50)]
  19.     private string $type;
  20.     #[ORM\Column(type'string'length30)]
  21.     private string $status PipelineIdentiteVisuelleMajItemStatus::NEW;
  22.     #[ORM\Column(type'text'nullabletrue)]
  23.     private ?string $clientComment null;
  24.     #[ORM\Column(type'integer')]
  25.     private int $step 0// incrémenté à chaque envoi de propositions
  26.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  27.     private ?\DateTimeImmutable $validatedAt null;
  28.     #[ORM\OneToMany(mappedBy'item'targetEntityPipelineIdentiteVisuelleMajProposal::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  29.     private Collection $proposals;
  30.     #[ORM\OneToMany(mappedBy'item'targetEntityPipelineIdentiteVisuelleMajMessage::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  31.     private Collection $messages;
  32.     public function __construct()
  33.     {
  34.         $this->proposals = new ArrayCollection();
  35.         $this->messages = new ArrayCollection();
  36.     }
  37.     public function getId(): ?int { return $this->id; }
  38.     public function getPipeline(): ?PipelineIdentiteVisuelleMaj { return $this->pipeline; }
  39.     public function setPipeline(?PipelineIdentiteVisuelleMaj $pipeline): self $this->pipeline $pipeline; return $this; }
  40.     public function getType(): string { return $this->type; }
  41.     public function setType(string $type): self $this->type $type; return $this; }
  42.     public function getStatus(): string { return $this->status; }
  43.     public function setStatus(string $status): self $this->status $status; return $this; }
  44.     public function getClientComment(): ?string { return $this->clientComment; }
  45.     public function setClientComment(?string $comment): self $this->clientComment $comment; return $this; }
  46.     public function getStep(): int { return $this->step; }
  47.     public function setStep(int $step): self $this->step $step; return $this; }
  48.     public function getValidatedAt(): ?\DateTimeImmutable { return $this->validatedAt; }
  49.     public function setValidatedAt(?\DateTimeImmutable $dt): self $this->validatedAt $dt; return $this; }
  50.     /** @return Collection<int, PipelineIdentiteVisuelleMajProposal> */
  51.     public function getProposals(): Collection { return $this->proposals; }
  52.     public function addProposal(PipelineIdentiteVisuelleMajProposal $proposal): self
  53.     {
  54.         if (!$this->proposals->contains($proposal)) {
  55.             $this->proposals->add($proposal);
  56.             $proposal->setItem($this);
  57.         }
  58.         return $this;
  59.     }
  60.     public function removeProposal(PipelineIdentiteVisuelleMajProposal $proposal): self
  61.     {
  62.         if ($this->proposals->removeElement($proposal)) {
  63.             if ($proposal->getItem() === $this) {
  64.                 $proposal->setItem(null);
  65.             }
  66.         }
  67.         return $this;
  68.     }
  69.     /** @return Collection<int, PipelineIdentiteVisuelleMajMessage> */
  70.     public function getMessages(): Collection { return $this->messages; }
  71.     public function addMessage(PipelineIdentiteVisuelleMajMessage $message): self
  72.     {
  73.         if (!$this->messages->contains($message)) {
  74.             $this->messages->add($message);
  75.             $message->setItem($this);
  76.         }
  77.         return $this;
  78.     }
  79. }