src/Entity/Credit.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\CreditRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCreditRepository::class)]
  8. #[ApiResource]
  9. class Credit
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(nullabletrue)]
  16.     private ?int $points_total null;
  17.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  18.     private ?Customer $custumer null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  20.     private ?\DateTimeInterface $date_created null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  22.     private ?\DateTimeInterface $date_expiration null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $qr_image null;
  25.     public function __construct()
  26.     {
  27.      $this->date_created = new \DateTimeImmutable();
  28.      $this->date_expiration = new \DateTimeImmutable();
  29.               
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getPointsTotal(): ?int
  36.     {
  37.         return $this->points_total;
  38.     }
  39.     public function setPointsTotal(?int $points_total): self
  40.     {
  41.         $this->points_total $points_total;
  42.         return $this;
  43.     }
  44.     public function getCustumer(): ?Customer
  45.     {
  46.         return $this->custumer;
  47.     }
  48.     public function setCustumer(?Customer $custumer): self
  49.     {
  50.         $this->custumer $custumer;
  51.         return $this;
  52.     }
  53.     public function getDateCreated(): ?\DateTimeInterface
  54.     {
  55.         return $this->date_created;
  56.     }
  57.     public function setDateCreated(\DateTimeInterface $date_created): self
  58.     {
  59.         $this->date_created $date_created;
  60.         return $this;
  61.     }
  62.     public function getDateExpiration(): ?\DateTimeInterface
  63.     {
  64.         return $this->date_expiration;
  65.     }
  66.     public function setDateExpiration(\DateTimeInterface $date_expiration): self
  67.     {
  68.         $this->date_expiration $date_expiration;
  69.         return $this;
  70.     }
  71.     public function getQrImage(): ?string
  72.     {
  73.         return $this->qr_image;
  74.     }
  75.     public function setQrImage(?string $qr_image): self
  76.     {
  77.         $this->qr_image $qr_image;
  78.         return $this;
  79.     }
  80. }