<?php
namespace App\Entity;
use App\Repository\PortRepository;
use Doctrine\ORM\Mapping as ORM;
use Overblog\GraphQLBundle\Annotation\Field;
use DateTimeImmutable;
#[ORM\Entity(repositoryClass: PortRepository::class)]
class Port extends BasicEntity
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: "integer")]
#[Field(name: "id", type: "int")]
private $id;
#[ORM\Column(type: "integer")]
#[Field(name: "port", type: "int")]
private $port;
#[ORM\ManyToMany(targetEntity: ExposedIp::class, mappedBy: 'ports')]
private $exposedIps;
#[ORM\Column(type: "boolean", options: ['default' => true])]
#[Field(name: "is_active", type: "boolean")]
private $isActive;
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
#[Field(name: "last_seen", type: "string")]
private $lastSeen;
#[ORM\ManyToOne(targetEntity: Status::class, inversedBy: 'exposedIps')]
#[ORM\JoinColumn(nullable: true, options: ['default' => 1])]
#[Field(name: "status")]
private $status;
public function getId(): ?int
{
return $this->id;
}
public function getPort(): ?int
{
return $this->port;
}
public function setPort(int $port): self
{
$this->port = $port;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getLastSeen(): ?DateTimeImmutable
{
return $this->lastSeen;
}
public function setLastSeen(?DateTimeImmutable $lastSeen): self
{
$this->lastSeen = $lastSeen;
return $this;
}
public function getStatus(): ?Status
{
return $this->status;
}
public function setStatus(?Status $status): self
{
$this->status = $status;
return $this;
}
}