<?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;
use App\Repository\ContactAppRepository;
/**
* ContactApp
*
* @ApiResource(attributes={"filters"={"contact_app.order", "contact_app.search"}, "pagination_items_per_page"=1})
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Repository\ContactAppRepository")
*/
class ContactApp
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var text
*
* @ORM\Column(name="email", type="text")
*
* @Assert\NotBlank()
*/
private $email;
/**
* @var string
*
* @ORM\Column(name="tel", type="string", length=255, nullable=true)
*/
private $tel;
/**
* @var text
*
* @ORM\Column(name="message", type="text", nullable=true)
*/
private $message;
/**
* @var string
*
* @ORM\Column(type="string", length=75)
*
* @Assert\NotBlank()
*/
private $type;
public function __toString()
{
return ($this->getEmail()) ? $this->getEmail() : '';
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Get email
*
* @return text
*/
public function getEmail()
{
return $this->email;
}
/**
* Set email
*
* @param text $email
*
* @return ContactApp
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get tel
*
* @return string
*/
public function getTel()
{
return $this->tel;
}
/**
* Set tel
*
* @param string $tel
*
* @return ContactApp
*/
public function setTel($tel)
{
$this->tel = $tel;
return $this;
}
/**
* Get message
*
* @return text
*/
public function getMessage()
{
return $this->message;
}
/**
* Set message
*
* @param text $message
*
* @return ContactApp
*/
public function setMessage($message)
{
$this->message = $message;
return $this;
}
/**
* Get type
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set type
*
* @param string $type
*
* @return ContactApp
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
}