<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use ApiPlatform\Core\Annotation\ApiResource;/** * @author <erwan> <erwan@kodiom.com> * * @ORM\Table() * @ORM\Entity(repositoryClass="App\Entity\ConfirmationSMSRepository") * @ApiResource() */class ConfirmationSMS{ /** * @var integer $id * * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var text * * @ORM\Column(type="integer") * @Assert\NotBlank() */ private $code; /** * @var \DateTime * * @ORM\Column(type="datetime") */ private $dateExpiration; /** * @var text * * @ORM\Column(name="phone", type="string", length=20) * @Assert\NotBlank() */ private $phone; /** * @var bool * * @ORM\Column(type="boolean") */ private $actif; /** * Constructor of ConfirmationSMS Entity */ public function __construct() { $this->code = mt_rand(100000, 999999); $this->dateExpiration = new \DateTime(); $this->actif = true; } public function __toString() { return ($this->getCode()) ? $this->getCode() : 'Unknown'; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Get code * * @return string */ public function getCode() { return $this->code; } /** * Set code * * @param string code * * @return ConfirmationSMS */ public function setCode($code) { $this->code = $code; return $this; } /** * Set dateExpiration * * @param \DateTime $dateExpiration * @return ConfirmationSMS */ public function setDateExpiration($dateExpiration) { $this->dateExpiration = $dateExpiration; return $this; } /** * Get dateExpiration * * @return \DateTime */ public function getDateExpiration() { return $this->dateExpiration; } /** * Get phone * * @return string */ public function getPhone() { return $this->phone; } /** * Set phone * * @param string $phone * * @return ConfirmationSMS */ public function setPhone($phone) { $this->phone = $phone; return $this; } /** * Get actif * * @return boolean */ public function getActif() { return $this->actif; } /** * Set actif * * @param bool $actif * * @return ConfirmationSMS */ public function setActif($actif) { $this->actif = $actif; return $this; }}