<?php
namespace App\Entity\Security;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\Security\IpBanRepository;
#[ORM\Entity(repositoryClass: IpBanRepository::class)]
#[ORM\Table(name: 'ip_ban')]
class IpBan
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $ip;
#[ORM\Column(type: 'datetime')]
private $startDate;
#[ORM\Column(type: 'datetime')]
private $endDate;
public function __construct()
{
$this->startDate = new \DateTime();
}
public function equals($object)
{
if ($object === null)
return false;
if ($this->id == $object->getId())
return true;
return false;
}
public function display()
{
return $this->ip;
}
public function displayForLog()
{
return "[".$this->id."] ".$this->display();
}
// End of Custom Methods
//--------------------------------------------------------------------------
public function getId(): ?int
{
return $this->id;
}
public function getIp(): ?string
{
return $this->ip;
}
public function setIp(string $ip): self
{
$this->ip = $ip;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
}