src/Entity/Invoice.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\InvoiceRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassInvoiceRepository::class)]
  8. #[ApiResource]
  9. class Invoice
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $reference null;
  17.     #[ORM\ManyToOne(inversedBy'invoices')]
  18.     private ?Customer $customer null;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?int $point null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  22.     private ?\DateTimeInterface $date_created null;
  23.     public function __construct()
  24.     {
  25.      $this->date_created = new \DateTimeImmutable();
  26.               
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getReference(): ?string
  33.     {
  34.         return $this->reference;
  35.     }
  36.     public function setReference(?string $reference): self
  37.     {
  38.         $this->reference $reference;
  39.         return $this;
  40.     }
  41.     public function getCustomer(): ?Customer
  42.     {
  43.         return $this->customer;
  44.     }
  45.     public function setCustomer(?Customer $customer): self
  46.     {
  47.         $this->customer $customer;
  48.         return $this;
  49.     }
  50.     public function getPoint(): ?int
  51.     {
  52.         return $this->point;
  53.     }
  54.     public function setPoint(?int $point): self
  55.     {
  56.         $this->point $point;
  57.         return $this;
  58.     }
  59.     public function getDateCreated(): ?\DateTimeInterface
  60.     {
  61.         return $this->date_created;
  62.     }
  63.     public function setDateCreated(?\DateTimeInterface $date_created): self
  64.     {
  65.         $this->date_created $date_created;
  66.         return $this;
  67.     }
  68. }