<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\AppCounterReadingRepository;
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;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use ApiPlatform\Core\Annotation\ApiProperty;
#[ORM\Entity(repositoryClass: AppCounterReadingRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['counterRead:read']],
denormalizationContext: ['groups' => ['counterRead:write']],
order: ['id' => 'DESC'],
)]
#[ApiFilter(SearchFilter::class, properties: [
'personal.id' => 'exact',
])]
class AppCounterReading
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['counterRead:read', 'counterRead:write', 'personalAcc:read', 'user:read'])]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'appCounterReadings')]
#[Groups(['counterRead:read', 'counterRead:write', 'personalAcc:read', 'user:read'])]
private ?AppPersonalAccount $personal = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Groups(['counterRead:read', 'counterRead:write', 'personalAcc:read', 'user:read'])]
private ?\DateTimeInterface $dateEntered = null;
#[ORM\Column(nullable: true)]
#[Groups(['counterRead:read', 'counterRead:write', 'personalAcc:read', 'user:read'])]
private ?int $value = null;
#[ORM\Column(nullable: true)]
#[Groups(['counterRead:read', 'counterRead:write', 'personalAcc:read', 'user:read'])]
private ?int $value2 = null;
#[ORM\Column(nullable: true)]
#[Groups(['counterRead:read', 'counterRead:write', 'personalAcc:read', 'user:read'])]
private ?int $value3 = null;
#[ORM\Column(length: 100, nullable: true)]
#[Groups(['counterRead:read', 'counterRead:write', 'personalAcc:read', 'user:read'])]
private ?string $status = null;
public function getId(): ?int
{
return $this->id;
}
public function getPersonal(): ?AppPersonalAccount
{
return $this->personal;
}
public function setPersonal(?AppPersonalAccount $personal): static
{
$this->personal = $personal;
return $this;
}
public function getDateEntered(): ?\DateTimeInterface
{
return $this->dateEntered;
}
public function setDateEntered(?\DateTimeInterface $dateEntered): static
{
$this->dateEntered = $dateEntered;
return $this;
}
public function getValue(): ?int
{
return $this->value;
}
public function setValue(?int $value): static
{
$this->value = $value;
return $this;
}
public function getValue2(): ?int
{
return $this->value2;
}
public function setValue2(?int $value2): static
{
$this->value2 = $value2;
return $this;
}
public function getValue3(): ?int
{
return $this->value3;
}
public function setValue3(?int $value3): static
{
$this->value3 = $value3;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): static
{
$this->status = $status;
return $this;
}
}