<?php
namespace App\Entity;
use App\Repository\MessageRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=MessageRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class Message
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/** * @ORM\Column(type="string", length=255) */ private $title; /** * @ORM\Column(type="text") */ private $content;
/**
* @ORM\Column(type="string", length=90)
*/
private $status;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=Company::class, inversedBy="messages")
* @ORM\JoinColumn(nullable=false)
*/
private $company;
/**
* @ORM\ManyToOne(targetEntity=User::class)
*/
private $owner;
public function getId(): ?int
{
return $this->id;
}
public function getContent(): ?string { return $this->content; }
public function setContent(string $content): self
{
$this->content = $content;
return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; }
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
public function getOwner(): ?User
{
return $this->owner;
}
public function setOwner(?User $owner): self
{
$this->owner = $owner;
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue(): void
{
$this->createdAt =new \DateTimeImmutable();
$this->updatedAt =new \DateTimeImmutable();
}
/**
* @ORM\PreUpdate
*/
public function setUpdatedAtValue(): void
{
$this->updatedAt =new \DateTimeImmutable();
}
/**
* @return mixed
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @param mixed $updatedAt
*/
public function setUpdatedAt($updatedAt): void
{
$this->updatedAt = $updatedAt;
}
}