src/Entity/PipelineMajWeb.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PipelineMajWebRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPipelineMajWebRepository::class)]
  8. class PipelineMajWeb
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private ?int $id null;
  14.     #[ORM\ManyToOne(targetEntityAccountingFirm::class)]
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     private ?AccountingFirm $accountingFirm null;
  17.     #[ORM\Column(type'string'length255)]
  18.     private string $status PipelineMajWebStatus::NEW;
  19.     #[ORM\Column(type'string'length255nullabletrue)]
  20.     private ?string $email null;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private ?string $trelloCardId null;
  23.     #[ORM\Column(type'datetime_immutable')]
  24.     private \DateTimeImmutable $createdAt;
  25.     #[ORM\Column(type'datetime_immutable')]
  26.     private \DateTimeImmutable $updatedAt;
  27.     #[ORM\OneToMany(mappedBy'pipelineMajWeb'targetEntityPipelineMajWebMessage::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  28.     #[ORM\OrderBy(['createdAt' => 'ASC'])]
  29.     private Collection $messages;
  30.     public function __construct()
  31.     {
  32.         $this->messages = new ArrayCollection();
  33.         $now = new \DateTimeImmutable();
  34.         $this->createdAt $now;
  35.         $this->updatedAt $now;
  36.     }
  37.     public function getId(): ?int { return $this->id; }
  38.     public function getAccountingFirm(): ?AccountingFirm { return $this->accountingFirm; }
  39.     public function setAccountingFirm(?AccountingFirm $accountingFirm): self $this->accountingFirm $accountingFirm; return $this; }
  40.     public function getStatus(): string { return $this->status; }
  41.     public function setStatus(string $status): self $this->status $status; return $this; }
  42.     public function getEmail(): ?string { return $this->email; }
  43.     public function setEmail(?string $email): self $this->email $email; return $this; }
  44.     public function getTrelloCardId(): ?string { return $this->trelloCardId; }
  45.     public function setTrelloCardId(?string $trelloCardId): self $this->trelloCardId $trelloCardId; return $this; }
  46.     public function getCreatedAt(): \DateTimeImmutable { return $this->createdAt; }
  47.     public function setCreatedAt(\DateTimeImmutable $createdAt): self $this->createdAt $createdAt; return $this; }
  48.     public function getUpdatedAt(): \DateTimeImmutable { return $this->updatedAt; }
  49.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self $this->updatedAt $updatedAt; return $this; }
  50.     /** @return Collection<int, PipelineMajWebMessage> */
  51.     public function getMessages(): Collection { return $this->messages; }
  52.     public function addMessage(PipelineMajWebMessage $message): self
  53.     {
  54.         if (!$this->messages->contains($message)) {
  55.             $this->messages[] = $message;
  56.             $message->setPipelineMajWeb($this);
  57.         }
  58.         return $this;
  59.     }
  60.     public function removeMessage(PipelineMajWebMessage $message): self
  61.     {
  62.         if ($this->messages->removeElement($message)) {
  63.             if ($message->getPipelineMajWeb() === $this) {
  64.                 $message->setPipelineMajWeb(null);
  65.             }
  66.         }
  67.         return $this;
  68.     }
  69.     public function touch(): void
  70.     {
  71.         $this->updatedAt = new \DateTimeImmutable();
  72.     }
  73. }