src/Entity/LoginBlocked.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM,
  4.     Doctrine\DBAL\Types\Types;
  5. use ApiPlatform\Metadata\ApiProperty;
  6. use App\Entity\Trait\IdTrait,
  7.     App\Entity\Trait\UuidTrait,
  8.     App\Entity\Trait\TimestampableTrait,
  9.     App\Repository\LoginBlockedRepository;
  10. #[ORM\Entity(repositoryClassLoginBlockedRepository::class)]
  11. class LoginBlocked
  12. {
  13.     use IdTrait,
  14.         UuidTrait,
  15.         TimestampableTrait;
  16.     #[ApiProperty(description'Origin ip')]
  17.     #[ORM\Column(typeTypes::STRINGlength191uniquetrue)]
  18.     private string $ip;
  19.     #[ApiProperty(description'Blocked since')]
  20.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLE)]
  21.     private \DateTimeImmutable $since;
  22.     public function __construct(string $ip\DateTimeImmutable $since)
  23.     {
  24.         $this->setUuid();
  25.         $this->ip $ip;
  26.         $this->since $since;
  27.         $this->createdAt = new \DateTimeImmutable();
  28.         $this->updatedAt = new \DateTimeImmutable();
  29.     }
  30.     public function getIp(): string
  31.     {
  32.         return $this->ip;
  33.     }
  34.     public function setSince(\DateTimeImmutable $since): self
  35.     {
  36.         $this->since $since;
  37.         return $this;
  38.     }
  39.     public function getSince(): \DateTimeImmutable
  40.     {
  41.         return $this->since;
  42.     }
  43. }