src/Entity/User/PasswordRecovery.php line 19
<?php
/**
* Created by PhpStorm.
* User: Михаил
* Date: 13.12.2018
* Time: 0:48
*/
namespace App\Entity\User;
use App\Entity\Traits\CreatedTrait;
use App\Entity\Traits\UpdatedTrait;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'user_password_recovery')]
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
class PasswordRecovery
{
use CreatedTrait;
use UpdatedTrait;
public const TYPE_PHONE = 'phone';
public const TYPE_EMAIL = 'email';
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: 'User')]
#[ORM\JoinColumn(nullable: false)]
private $user;
#[ORM\Column(type: 'string', unique: true, length: 100)]
private $token;
/**
* @var bool
*/
#[ORM\Column(type: 'boolean')]
private $used = 0;
#[ORM\Column(type: 'string')]
private $type;
/**
* @var DateTime
*/
#[ORM\Column(type: 'datetime')]
private $valid_till;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id): void
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getUser(): User
{
return $this->user;
}
/**
* @param mixed $user
*/
public function setUser(User $user): void
{
$this->user = $user;
}
/**
* @return mixed
*/
public function getToken(): string
{
return $this->token;
}
/**
* @param mixed $token
*/
public function setToken(string $token): void
{
$this->token = $token;
}
/**
* @return bool
*/
public function isUsed(): bool
{
return $this->used;
}
/**
* @param bool $used
*/
public function setUsed(bool $used): void
{
$this->used = $used;
}
/**
* @return mixed
*/
public function getType()
{
return $this->type;
}
/**
* @param mixed $type
*/
public function setType($type): void
{
$this->type = $type;
}
/**
* @return DateTime
*/
public function getValidTill(): DateTime
{
return $this->valid_till;
}
/**
* @param DateTime $valid_till
*/
public function setValidTill(DateTime $valid_till): void
{
$this->valid_till = $valid_till;
}
}