<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\CreditRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CreditRepository::class)]
#[ApiResource]
class Credit
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(nullable: true)]
private ?int $points_total = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Customer $custumer = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $date_created = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $date_expiration = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $qr_image = null;
public function __construct()
{
$this->date_created = new \DateTimeImmutable();
$this->date_expiration = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getPointsTotal(): ?int
{
return $this->points_total;
}
public function setPointsTotal(?int $points_total): self
{
$this->points_total = $points_total;
return $this;
}
public function getCustumer(): ?Customer
{
return $this->custumer;
}
public function setCustumer(?Customer $custumer): self
{
$this->custumer = $custumer;
return $this;
}
public function getDateCreated(): ?\DateTimeInterface
{
return $this->date_created;
}
public function setDateCreated(\DateTimeInterface $date_created): self
{
$this->date_created = $date_created;
return $this;
}
public function getDateExpiration(): ?\DateTimeInterface
{
return $this->date_expiration;
}
public function setDateExpiration(\DateTimeInterface $date_expiration): self
{
$this->date_expiration = $date_expiration;
return $this;
}
public function getQrImage(): ?string
{
return $this->qr_image;
}
public function setQrImage(?string $qr_image): self
{
$this->qr_image = $qr_image;
return $this;
}
}