<?php
namespace App\Entity;
use App\Repository\ContactProductRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=ContactProductRepository::class)
*/
class ContactProduct
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*
* @Assert\NotBlank()
*/
private $email;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $message;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="contactProducts")
*/
private $product;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="boolean")
*/
private $isSended;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->isSended = false;
}
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getIsSended(): ?bool
{
return $this->isSended;
}
public function setIsSended(bool $isSended): self
{
$this->isSended = $isSended;
return $this;
}
}