src/Entity/Message.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MessageRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassMessageRepository::class)]
  9. class Message
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255nullabletrue)]
  16.     private $type;
  17.     #[ORM\Column(type'text'nullabletrue)]
  18.     private $content;
  19.     #[ORM\OneToOne(targetEntityBooking::class, cascade: ['persist''remove'])]
  20.     private $booking;
  21.     #[ORM\Column(type'datetime')]
  22.     private $createdAt;
  23.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'sentMessages')]
  24.     private $sender;
  25.     #[ORM\ManyToOne(targetEntityConversation::class, inversedBy'messages')]
  26.     private $conversation;
  27.     #[ORM\Column(type'boolean')]
  28.     private $isReaded;
  29.     #[ORM\OneToOne(targetEntityPaymentRequest::class, cascade: ['persist''remove'])]
  30.     private $paymentRequest;
  31.     #[ORM\OneToMany(targetEntityAttachedFile::class, mappedBy'message')]
  32.     private $attachedFiles;
  33.     #[ORM\Column(type'string'nullabletrue)]
  34.     private $toRate;
  35.     #[ORM\OneToOne(targetEntityNote::class, cascade: ['persist''remove'])]
  36.     private $note;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $bookingRef null;
  39.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  40.     private ?\DateTimeInterface $lastReminder null;
  41.     public function __construct()
  42.     {
  43.         $this->attachedFiles = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getType(): ?string
  50.     {
  51.         return $this->type;
  52.     }
  53.     public function setType(?string $type): self
  54.     {
  55.         $this->type $type;
  56.         return $this;
  57.     }
  58.     public function getContent(): ?string
  59.     {
  60.         return $this->content;
  61.     }
  62.     public function setContent(?string $content): self
  63.     {
  64.         $this->content $content;
  65.         return $this;
  66.     }
  67.     public function getBooking(): ?Booking
  68.     {
  69.         return $this->booking;
  70.     }
  71.     public function setBooking(?Booking $booking): self
  72.     {
  73.         $this->booking $booking;
  74.         return $this;
  75.     }
  76.     public function getCreatedAt(): ?\DateTimeInterface
  77.     {
  78.         return $this->createdAt;
  79.     }
  80.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  81.     {
  82.         $this->createdAt $createdAt;
  83.         return $this;
  84.     }
  85.     public function getSender(): ?User
  86.     {
  87.         return $this->sender;
  88.     }
  89.     public function setSender(?User $sender): self
  90.     {
  91.         $this->sender $sender;
  92.         return $this;
  93.     }
  94.     public function getConversation(): ?Conversation
  95.     {
  96.         return $this->conversation;
  97.     }
  98.     public function setConversation(?Conversation $conversation): self
  99.     {
  100.         $this->conversation $conversation;
  101.         return $this;
  102.     }
  103.     public function getIsReaded(): ?bool
  104.     {
  105.         return $this->isReaded;
  106.     }
  107.     public function setIsReaded(bool $isReaded): self
  108.     {
  109.         $this->isReaded $isReaded;
  110.         return $this;
  111.     }
  112.     public function getPaymentRequest(): ?PaymentRequest
  113.     {
  114.         return $this->paymentRequest;
  115.     }
  116.     public function setPaymentRequest(?PaymentRequest $paymentRequest): self
  117.     {
  118.         $this->paymentRequest $paymentRequest;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection|AttachedFile[]
  123.      */
  124.     public function getAttachedFiles(): Collection
  125.     {
  126.         return $this->attachedFiles;
  127.     }
  128.     public function addAttachedFile(AttachedFile $attachedFile): self
  129.     {
  130.         if (!$this->attachedFiles->contains($attachedFile)) {
  131.             $this->attachedFiles[] = $attachedFile;
  132.             $attachedFile->setMessage($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeAttachedFile(AttachedFile $attachedFile): self
  137.     {
  138.         if ($this->attachedFiles->removeElement($attachedFile)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($attachedFile->getMessage() === $this) {
  141.                 $attachedFile->setMessage(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     public function getToRate(): ?string
  147.     {
  148.         return $this->toRate;
  149.     }
  150.     public function setToRate(?string $toRate): self
  151.     {
  152.         $this->toRate $toRate;
  153.         return $this;
  154.     }
  155.     public function getNote(): ?Note
  156.     {
  157.         return $this->note;
  158.     }
  159.     public function setNote(?Note $note): self
  160.     {
  161.         $this->note $note;
  162.         return $this;
  163.     }
  164.     public function getBookingRef(): ?string
  165.     {
  166.         return $this->bookingRef;
  167.     }
  168.     public function setBookingRef(?string $bookingRef): static
  169.     {
  170.         $this->bookingRef $bookingRef;
  171.         return $this;
  172.     }
  173.     public function getLastReminder(): ?\DateTimeInterface
  174.     {
  175.         return $this->lastReminder;
  176.     }
  177.     public function setLastReminder(?\DateTimeInterface $lastReminder): static
  178.     {
  179.         $this->lastReminder $lastReminder;
  180.         return $this;
  181.     }
  182. }