<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\SpNpSettlementsRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
#[ORM\Entity(repositoryClass: SpNpSettlementsRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['sp_np:read']],
denormalizationContext: ['groups' => ['sp_np:write']],
order: ['name' => 'ASC']
)]
#[ApiFilter(SearchFilter::class, properties: [
'ref' => 'exact',
'name' => 'ipartial'
])]
class SpNpSettlements
{
#[Groups(['sp_np:read', 'sp_np:write', 'sp:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[Groups(['sp_np:read', 'sp_np:write', 'sp:read'])]
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[Groups(['sp_np:read', 'sp_np:write', 'sp:read'])]
#[ORM\Column(length: 255, nullable: true)]
private ?string $area = null;
#[Groups(['sp_np:read', 'sp_np:write', 'sp:read'])]
#[ORM\Column(length: 255, nullable: true)]
private ?string $ref = null;
#[Groups(['sp_np:read', 'sp_np:write', 'sp:read'])]
#[ORM\Column(nullable: true)]
private ?array $object = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getArea(): ?string
{
return $this->area;
}
public function setArea(?string $area): static
{
$this->area = $area;
return $this;
}
public function getRef(): ?string
{
return $this->ref;
}
public function setRef(?string $ref): static
{
$this->ref = $ref;
return $this;
}
public function getObject(): ?array
{
return $this->object;
}
public function setObject(?array $object): static
{
$this->object = $object;
return $this;
}
}