<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\PwAddressQueueRepository;
use Doctrine\DBAL\Types\Types;
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: PwAddressQueueRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['PwAddressQ:read']],
denormalizationContext: ['groups' => ['PwAddressQ: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' ,
'buildingNames' => 'ipartial'
])]
class PwAddressQueue
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\Column]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'pwAddressQueues')]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?PwOtg $otg = null;
#[ORM\ManyToOne(inversedBy: 'pwAddressQueues')]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?PwCity $city = null;
#[ORM\ManyToOne(inversedBy: 'pwAddressQueues')]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?PwStreet $street = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?string $buildingNames = null;
#[ORM\Column(length: 20, nullable: true)]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?string $chergGpv = null;
#[ORM\Column(length: 20, nullable: true)]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?string $chergGav = null;
#[ORM\Column(length: 20, nullable: true)]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?string $chergAchr = null;
#[ORM\Column(length: 20, nullable: true)]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?string $chergGvsp = null;
#[ORM\Column(length: 20, nullable: true)]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?string $chergSgav = null;
#[ORM\Column(length: 50, nullable: true, unique: true)]
#[Groups(['PwAddressQ:read', 'PwAddressQ:write'])]
private ?string $hash = 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 getBuildingNames(): ?string
{
return $this->buildingNames;
}
public function setBuildingNames(?string $buildingNames): static
{
$this->buildingNames = $buildingNames;
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 getHash(): ?string
{
return $this->hash;
}
public function setHash(?string $hash): static
{
$this->hash = $hash;
return $this;
}
}