src/Entity/LoginBlocked.php line 15
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM,
Doctrine\DBAL\Types\Types;
use ApiPlatform\Metadata\ApiProperty;
use App\Entity\Trait\IdTrait,
App\Entity\Trait\UuidTrait,
App\Entity\Trait\TimestampableTrait,
App\Repository\LoginBlockedRepository;
#[ORM\Entity(repositoryClass: LoginBlockedRepository::class)]
class LoginBlocked
{
use IdTrait,
UuidTrait,
TimestampableTrait;
#[ApiProperty(description: 'Origin ip')]
#[ORM\Column(type: Types::STRING, length: 191, unique: true)]
private string $ip;
#[ApiProperty(description: 'Blocked since')]
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
private \DateTimeImmutable $since;
public function __construct(string $ip, \DateTimeImmutable $since)
{
$this->setUuid();
$this->ip = $ip;
$this->since = $since;
$this->createdAt = new \DateTimeImmutable();
$this->updatedAt = new \DateTimeImmutable();
}
public function getIp(): string
{
return $this->ip;
}
public function setSince(\DateTimeImmutable $since): self
{
$this->since = $since;
return $this;
}
public function getSince(): \DateTimeImmutable
{
return $this->since;
}
}