src/Entity/ContactProduct.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContactProductRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ContactProductRepository::class)
  8.  */
  9. class ContactProduct
  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.      * @Assert\NotBlank()
  21.      */
  22.     private $email;
  23.     /**
  24.      * @ORM\Column(type="text", nullable=true)
  25.      */
  26.     private $message;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="contactProducts")
  29.      */
  30.     private $product;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $createdAt;
  35.     /**
  36.      * @ORM\Column(type="boolean")
  37.      */
  38.     private $isSended;
  39.     public function __construct()
  40.     {
  41.         $this->createdAt = new \DateTime();
  42.         $this->isSended false;
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getEmail(): ?string
  49.     {
  50.         return $this->email;
  51.     }
  52.     public function setEmail(string $email): self
  53.     {
  54.         $this->email $email;
  55.         return $this;
  56.     }
  57.     public function getMessage(): ?string
  58.     {
  59.         return $this->message;
  60.     }
  61.     public function setMessage(?string $message): self
  62.     {
  63.         $this->message $message;
  64.         return $this;
  65.     }
  66.     public function getProduct(): ?Product
  67.     {
  68.         return $this->product;
  69.     }
  70.     public function setProduct(?Product $product): self
  71.     {
  72.         $this->product $product;
  73.         return $this;
  74.     }
  75.     public function getCreatedAt(): ?\DateTimeInterface
  76.     {
  77.         return $this->createdAt;
  78.     }
  79.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  80.     {
  81.         $this->createdAt $createdAt;
  82.         return $this;
  83.     }
  84.     public function getIsSended(): ?bool
  85.     {
  86.         return $this->isSended;
  87.     }
  88.     public function setIsSended(bool $isSended): self
  89.     {
  90.         $this->isSended $isSended;
  91.         return $this;
  92.     }
  93. }