src/Entity/CRM/DebtStatus.php line 13

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Order;
  4. use App\Repository\DebtStatusRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassDebtStatusRepository::class)]
  10. class DebtStatus
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $name null;
  18.     #[ORM\Column]
  19.     private ?bool $isActive null;
  20.     #[ORM\OneToMany(mappedBy'debtStatus'targetEntityOrder::class)]
  21.     private Collection $orders;
  22.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  23.     private ?string $mailText null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $mailSubject null;
  26.     #[ORM\Column]
  27.     private bool $sendMail false;
  28.     public function __toString(): string
  29.     {
  30.         return $this->name;
  31.     }
  32.     public function __construct()
  33.     {
  34.         $this->orders = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getName(): ?string
  41.     {
  42.         return $this->name;
  43.     }
  44.     public function setName(string $name): static
  45.     {
  46.         $this->name $name;
  47.         return $this;
  48.     }
  49.     public function isIsActive(): ?bool
  50.     {
  51.         return $this->isActive;
  52.     }
  53.     public function setIsActive(bool $isActive): static
  54.     {
  55.         $this->isActive $isActive;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, Order>
  60.      */
  61.     public function getOrders(): Collection
  62.     {
  63.         return $this->orders;
  64.     }
  65.     public function addOrder(Order $order): static
  66.     {
  67.         if (!$this->orders->contains($order)) {
  68.             $this->orders->add($order);
  69.             $order->setDebtStatus($this);
  70.         }
  71.         return $this;
  72.     }
  73.     public function removeOrder(Order $order): static
  74.     {
  75.         if ($this->orders->removeElement($order)) {
  76.             // set the owning side to null (unless already changed)
  77.             if ($order->getDebtStatus() === $this) {
  78.                 $order->setDebtStatus(null);
  79.             }
  80.         }
  81.         return $this;
  82.     }
  83.     public function getMailText(): ?string
  84.     {
  85.         return $this->mailText;
  86.     }
  87.     public function setMailText(?string $mailText): static
  88.     {
  89.         $this->mailText $mailText;
  90.         return $this;
  91.     }
  92.     public function getMailSubject(): ?string
  93.     {
  94.         return $this->mailSubject;
  95.     }
  96.     public function setMailSubject(?string $mailSubject): static
  97.     {
  98.         $this->mailSubject $mailSubject;
  99.         return $this;
  100.     }
  101.     public function isSendMail(): bool
  102.     {
  103.         return $this->sendMail;
  104.     }
  105.     public function setSendMail(bool $sendMail): static
  106.     {
  107.         $this->sendMail $sendMail;
  108.         return $this;
  109.     }
  110. }