src/Entity/Message.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MessageRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=MessageRepository::class)
  7.  * @ORM\HasLifecycleCallbacks
  8.  */
  9. class Message
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $title;
  21.     /**
  22.      * @ORM\Column(type="text")
  23.      */
  24.     private $content;
  25.     /**
  26.      * @ORM\Column(type="string", length=90)
  27.      */
  28.     private $status;
  29.     /**
  30.      * @ORM\Column(type="datetime_immutable")
  31.      */
  32.     private $createdAt;
  33.     /**
  34.      * @ORM\Column(type="datetime_immutable")
  35.      */
  36.     private $updatedAt;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="messages")
  39.      * @ORM\JoinColumn(nullable=false)
  40.      */
  41.     private $company;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=User::class)
  44.      */
  45.     private $owner;
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getContent(): ?string
  51.     {
  52.         return $this->content;
  53.     }
  54.     public function setContent(string $content): self
  55.     {
  56.         $this->content $content;
  57.         return $this;
  58.     }
  59.     public function getTitle(): ?string
  60.     {
  61.         return $this->title;
  62.     }
  63.     public function setTitle(string $title): self
  64.     {
  65.         $this->title $title;
  66.         return $this;
  67.     }
  68.     public function getStatus(): ?string
  69.     {
  70.         return $this->status;
  71.     }
  72.     public function setStatus(string $status): self
  73.     {
  74.         $this->status $status;
  75.         return $this;
  76.     }
  77.     public function getCreatedAt(): ?\DateTimeImmutable
  78.     {
  79.         return $this->createdAt;
  80.     }
  81.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  82.     {
  83.         $this->createdAt $createdAt;
  84.         return $this;
  85.     }
  86.     public function getCompany(): ?Company
  87.     {
  88.         return $this->company;
  89.     }
  90.     public function setCompany(?Company $company): self
  91.     {
  92.         $this->company $company;
  93.         return $this;
  94.     }
  95.     public function getOwner(): ?User
  96.     {
  97.         return $this->owner;
  98.     }
  99.     public function setOwner(?User $owner): self
  100.     {
  101.         $this->owner $owner;
  102.         return $this;
  103.     }
  104.     /**
  105.      * @ORM\PrePersist
  106.      */
  107.     public function setCreatedAtValue(): void
  108.     {
  109.         $this->createdAt =new \DateTimeImmutable();
  110.         $this->updatedAt =new \DateTimeImmutable();
  111.     }
  112.     /**
  113.      * @ORM\PreUpdate
  114.      */
  115.     public function setUpdatedAtValue(): void
  116.     {
  117.         $this->updatedAt =new \DateTimeImmutable();
  118.     }
  119.     /**
  120.      * @return mixed
  121.      */
  122.     public function getUpdatedAt()
  123.     {
  124.         return $this->updatedAt;
  125.     }
  126.     /**
  127.      * @param mixed $updatedAt
  128.      */
  129.     public function setUpdatedAt($updatedAt): void
  130.     {
  131.         $this->updatedAt $updatedAt;
  132.     }
  133. }