<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\PwAccountRepository;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: PwAccountRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['PwAccount:read']],
denormalizationContext: ['groups' => ['PwAccount:write']],
cacheHeaders: [
'max_age' => 3600,
'shared_max_age' => 7200,
'vary' => ['Authorization', 'Accept-Language']
]
)]
#[ApiFilter(SearchFilter::class, properties: ['city.id' => 'exact', 'street.id' => 'exact', 'otg.id' => 'exact' , 'buildingName' => 'exact', 'acc' => 'exact', 'name' => 'ipartial'])]
class PwAccount
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\Column]
#[Groups(['PwAccount:read', 'PwAccount:write'])]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'accounts')]
private ?PwOtg $otg = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\ManyToOne(inversedBy: 'accounts')]
private ?PwCity $city = null;
#[ORM\ManyToOne(inversedBy: 'accounts')]
private ?PwStreet $street = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\Column(length: 50, nullable: true)]
private ?string $buildingName = null;
#[ORM\Column(length: 20)]
private ?string $acc = null;
#[ORM\Column(length: 50, unique: true)]
private ?string $eicKod = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\Column(length: 20, nullable: true)]
private ?string $chergGpv = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\Column(length: 20, nullable: true)]
private ?string $chergGav = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\Column(length: 20, nullable: true)]
private ?string $chergAchr = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\Column(length: 20, nullable: true)]
private ?string $chergGvsp = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\Column(length: 20, nullable: true)]
private ?string $chergSgav = null;
#[ORM\Column(length: 1000, nullable: true)]
private ?string $name = null;
#[Groups(['PwAccount:read', 'PwAccount:write'])]
#[ORM\Column(nullable: true)]
private ?bool $disconnectionTask = null;
public function getId(): ?int
{
return $this->id;
}
public function getOtg(): ?PwOtg
{
return $this->otg;
}
public function setOtg(?PwOtg $otg): static
{
$this->otg = $otg;
return $this;
}
public function getCity(): ?PwCity
{
return $this->city;
}
public function setCity(?PwCity $city): static
{
$this->city = $city;
return $this;
}
public function getStreet(): ?PwStreet
{
return $this->street;
}
public function setStreet(?PwStreet $street): static
{
$this->street = $street;
return $this;
}
public function getBuildingName(): ?string
{
return $this->buildingName;
}
public function setBuildingName(?string $buildingName): static
{
$this->buildingName = $buildingName;
return $this;
}
public function getAcc(): ?string
{
return $this->acc;
}
public function setAcc(string $acc): static
{
$this->acc = $acc;
return $this;
}
public function getEicKod(): ?string
{
return $this->eicKod;
}
public function setEicKod(string $eicKod): static
{
$this->eicKod = $eicKod;
return $this;
}
public function getChergGpv(): ?string
{
return $this->chergGpv;
}
public function setChergGpv(?string $chergGpv): static
{
$this->chergGpv = $chergGpv;
return $this;
}
public function getChergGav(): ?string
{
return $this->chergGav;
}
public function setChergGav(?string $chergGav): static
{
$this->chergGav = $chergGav;
return $this;
}
public function getChergAchr(): ?string
{
return $this->chergAchr;
}
public function setChergAchr(?string $chergAchr): static
{
$this->chergAchr = $chergAchr;
return $this;
}
public function getChergGvsp(): ?string
{
return $this->chergGvsp;
}
public function setChergGvsp(?string $chergGvsp): static
{
$this->chergGvsp = $chergGvsp;
return $this;
}
public function getChergSgav(): ?string
{
return $this->chergSgav;
}
public function setChergSgav(?string $chergSgav): static
{
$this->chergSgav = $chergSgav;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function isDisconnectionTask(): ?bool
{
return $this->disconnectionTask;
}
public function setDisconnectionTask(?bool $disconnectionTask): static
{
$this->disconnectionTask = $disconnectionTask;
return $this;
}
}