<?php

namespace App\Entity;

use App\Repository\MessageRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: MessageRepository::class)]
class Message
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\ManyToOne]
    private ?UserApp $sender = null;

    #[ORM\ManyToOne]
    private ?UserApp $receiver = null;

    #[ORM\Column(type: Types::TEXT)]
    private ?string $content = null;

    #[ORM\Column(type: Types::DATETIME_MUTABLE)]
    private ?\DateTimeInterface $sendingDate = null;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getSender(): ?UserApp
    {
        return $this->sender;
    }

    public function setSender(?UserApp $sender): static
    {
        $this->sender = $sender;

        return $this;
    }

    public function getReceiver(): ?UserApp
    {
        return $this->receiver;
    }

    public function setReceiver(?UserApp $receiver): static
    {
        $this->receiver = $receiver;

        return $this;
    }

    public function getContent(): ?string
    {
        return $this->content;
    }

    public function setContent(string $content): static
    {
        $this->content = $content;

        return $this;
    }

    public function getSendingDate(): ?\DateTimeInterface
    {
        return $this->sendingDate;
    }

    public function setSendingDate(\DateTimeInterface $sendingDate): static
    {
        $this->sendingDate = $sendingDate;

        return $this;
    }
}
