src/Entity/Security/IpBan.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Security;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\Security\IpBanRepository;
  5. #[ORM\Entity(repositoryClassIpBanRepository::class)]
  6. #[ORM\Table(name'ip_ban')]
  7. class IpBan
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length255)]
  14.     private $ip;
  15.     #[ORM\Column(type'datetime')]
  16.     private $startDate;
  17.     #[ORM\Column(type'datetime')]
  18.     private $endDate;
  19.     public function __construct()
  20.     {
  21.         $this->startDate = new \DateTime();
  22.     }
  23.     public function equals($object)
  24.     {
  25.         if ($object === null)
  26.             return false;
  27.         if ($this->id == $object->getId())
  28.             return true;
  29.         return false;
  30.     }
  31.     public function display()
  32.     {
  33.         return $this->ip;
  34.     }
  35.     public function displayForLog()
  36.     {
  37.         return "[".$this->id."] ".$this->display();
  38.     }
  39.     // End of Custom Methods
  40.     //--------------------------------------------------------------------------
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getIp(): ?string
  46.     {
  47.         return $this->ip;
  48.     }
  49.     public function setIp(string $ip): self
  50.     {
  51.         $this->ip $ip;
  52.         return $this;
  53.     }
  54.     public function getStartDate(): ?\DateTimeInterface
  55.     {
  56.         return $this->startDate;
  57.     }
  58.     public function setStartDate(\DateTimeInterface $startDate): self
  59.     {
  60.         $this->startDate $startDate;
  61.         return $this;
  62.     }
  63.     public function getEndDate(): ?\DateTimeInterface
  64.     {
  65.         return $this->endDate;
  66.     }
  67.     public function setEndDate(\DateTimeInterface $endDate): self
  68.     {
  69.         $this->endDate $endDate;
  70.         return $this;
  71.     }
  72. }