<?php/* * This file is part of the kProjet project. * * (c) Kodiom <info@kodiom.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */namespace App\Entity;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use ApiPlatform\Core\Annotation\ApiResource;/** * ContactMessage * * @ORM\Table() * @ORM\Entity(repositoryClass="App\Entity\ContactMessageRepository") * @ApiResource( * collectionOperations={"get"={"method"="GET"}, "post"={"method"="POST"}}, * itemOperations={"get"={"method"="GET"}} * ) */class ContactMessage{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="nom", type="string", length=50) * * @Assert\NotBlank() */ private $nom; /** * @var string * * @ORM\Column(name="email", type="string", length=255) * * @Assert\NotBlank() */ private $email; /** * @var text * * @ORM\Column(name="message", type="text") * * @Assert\NotBlank() */ private $message; public function __toString() { return ($this->getNom()) ? $this->getNom() : ''; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Get nom * * @return string */ public function getNom() { return $this->nom; } /** * Set nom * * @param string $nom * * @return ContactMessage */ public function setNom($nom) { $this->nom = $nom; return $this; } /** * Get email * * @return string */ public function getEmail() { return $this->email; } /** * Set email * * @param string $email * * @return ContactMessage */ public function setEmail($email) { $this->email = $email; return $this; } /** * Get message * * @return text */ public function getMessage() { return $this->message; } /** * Set message * * @param text $message * * @return ContactMessage */ public function setMessage($message) { $this->message = $message; return $this; }}