src/Entity/CRM/Task.php line 10

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\TaskRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassTaskRepository::class)]
  7. class Task
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'tasks')]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private ?DirectMessage $directMessage null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $description null;
  18.     #[ORM\Column]
  19.     private ?bool $isDone null;
  20.     #[ORM\ManyToOne(inversedBy'tasks')]
  21.     private ?Order $orderInstance null;
  22.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  23.     private ?\DateTimeInterface $doneDate null;
  24.     #[ORM\Column]
  25.     private ?bool $accepted null;
  26.     #[ORM\ManyToOne(inversedBy'acceptedTasks')]
  27.     private ?Admin $acceptedBy null;
  28.     public function __toString(): string
  29.     {
  30.         $description $this->getDescription();
  31.         if($description !== '') {
  32.             $isChecked $this->isDone 'checked' '';
  33.             return '<input class="form-check-input" value="' $this->id '" name="task-' $this->id '" type="checkbox" id="task-' $this->id '"' $isChecked '>
  34.                 <label class="form-check-label" for="task-' $this->id '">' $description '</label><br>';
  35.         } else return '';
  36.     }
  37.     public function __construct()
  38.     {
  39.         $this->accepted false;
  40.         $this->isDone false;
  41.         $this->acceptedBy null;
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getDirectMessage(): ?DirectMessage
  48.     {
  49.         return $this->directMessage;
  50.     }
  51.     public function setDirectMessage(?DirectMessage $directMessage): static
  52.     {
  53.         $this->directMessage $directMessage;
  54.         return $this;
  55.     }
  56.     public function getDescription(): ?string
  57.     {
  58.         return $this->description;
  59.     }
  60.     public function setDescription(string $description): static
  61.     {
  62.         $this->description $description;
  63.         return $this;
  64.     }
  65.     public function isDone(): ?bool
  66.     {
  67.         return $this->isDone;
  68.     }
  69.     public function setIsDone(bool $isDone): static
  70.     {
  71.         $this->isDone $isDone;
  72.         return $this;
  73.     }
  74.     public function getOrderInstance(): ?Order
  75.     {
  76.         return $this->orderInstance;
  77.     }
  78.     public function setOrderInstance(?Order $orderInstance): static
  79.     {
  80.         $this->orderInstance $orderInstance;
  81.         return $this;
  82.     }
  83.     public function getDoneDate(): ?\DateTimeInterface
  84.     {
  85.         return $this->doneDate;
  86.     }
  87.     public function setDoneDate(?\DateTimeInterface $doneDate): static
  88.     {
  89.         $this->doneDate $doneDate;
  90.         return $this;
  91.     }
  92.     public function isAccepted(): ?bool
  93.     {
  94.         return $this->accepted;
  95.     }
  96.     public function setAccepted(bool $accepted): static
  97.     {
  98.         $this->accepted $accepted;
  99.         return $this;
  100.     }
  101.     public function getAcceptedBy(): ?Admin
  102.     {
  103.         return $this->acceptedBy;
  104.     }
  105.     public function setAcceptedBy(?Admin $acceptedBy): static
  106.     {
  107.         $this->acceptedBy $acceptedBy;
  108.         return $this;
  109.     }
  110. }