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\Column(type'integer')]
  28.     private int $relaunchCount 0;
  29.     #[ORM\OneToMany(mappedBy'pipelineMajWeb'targetEntityPipelineMajWebMessage::class, cascade: ['persist''remove'], orphanRemovaltrue)]
  30.     #[ORM\OrderBy(['createdAt' => 'ASC'])]
  31.     private Collection $messages;
  32.     public function __construct()
  33.     {
  34.         $this->messages = new ArrayCollection();
  35.         $now = new \DateTimeImmutable();
  36.         $this->createdAt $now;
  37.         $this->updatedAt $now;
  38.     }
  39.     public function getId(): ?int { return $this->id; }
  40.     public function getAccountingFirm(): ?AccountingFirm { return $this->accountingFirm; }
  41.     public function setAccountingFirm(?AccountingFirm $accountingFirm): self $this->accountingFirm $accountingFirm; 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 getEmail(): ?string { return $this->email; }
  45.     public function setEmail(?string $email): self $this->email $email; return $this; }
  46.     public function getTrelloCardId(): ?string { return $this->trelloCardId; }
  47.     public function setTrelloCardId(?string $trelloCardId): self $this->trelloCardId $trelloCardId; return $this; }
  48.     public function getCreatedAt(): \DateTimeImmutable { return $this->createdAt; }
  49.     public function setCreatedAt(\DateTimeImmutable $createdAt): self $this->createdAt $createdAt; return $this; }
  50.     public function getUpdatedAt(): \DateTimeImmutable { return $this->updatedAt; }
  51.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self $this->updatedAt $updatedAt; return $this; }
  52.     public function getRelaunchCount(): int { return $this->relaunchCount; }
  53.     public function setRelaunchCount(int $count): self $this->relaunchCount $count; return $this; }
  54.     /** @return Collection<int, PipelineMajWebMessage> */
  55.     public function getMessages(): Collection { return $this->messages; }
  56.     public function addMessage(PipelineMajWebMessage $message): self
  57.     {
  58.         if (!$this->messages->contains($message)) {
  59.             $this->messages[] = $message;
  60.             $message->setPipelineMajWeb($this);
  61.         }
  62.         return $this;
  63.     }
  64.     public function removeMessage(PipelineMajWebMessage $message): self
  65.     {
  66.         if ($this->messages->removeElement($message)) {
  67.             if ($message->getPipelineMajWeb() === $this) {
  68.                 $message->setPipelineMajWeb(null);
  69.             }
  70.         }
  71.         return $this;
  72.     }
  73.     public function touch(): void
  74.     {
  75.         $this->updatedAt = new \DateTimeImmutable();
  76.     }
  77. }