<?php
namespace App\Entity;
use App\Repository\OrderMessageRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=OrderMessageRepository::class)
*/
class OrderMessage
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Order::class, inversedBy="orderMessages")
* @ORM\JoinColumn(onDelete="CASCADE")
* @ORM\JoinColumn(nullable=false)
*/
private $order_;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="orderMessages")
* @ORM\JoinColumn(onDelete="CASCADE")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="datetime")
*/
private $date_added;
/**
* @ORM\Column(type="string", length=510)
* @Assert\Length(
* max = 510
* )
*/
private $message;
public function getId(): ?int
{
return $this->id;
}
public function getOrder(): ?Order
{
return $this->order_;
}
public function setOrder(?Order $order_): self
{
$this->order_ = $order_;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getDateAdded(): ?\DateTimeInterface
{
return $this->date_added;
}
public function setDateAdded(\DateTimeInterface $date_added): self
{
$this->date_added = $date_added;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
}