src/Entity/Invoice.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InvoiceRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassInvoiceRepository::class)]
  6. class Invoice
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private ?int $id null;
  12.     #[ORM\Column(type'string'length50uniquetrue)]
  13.     private ?string $invoiceNumber null;
  14.     #[ORM\Column(type'datetime')]
  15.     private ?\DateTimeInterface $issuedAt null;
  16.     #[ORM\Column(type'float')]
  17.     private ?float $total null;
  18.     #[ORM\OneToOne(targetEntityOrder::class, inversedBy'invoice'cascade: ['persist''remove'])]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Order $order null;
  21.     // Getters y setters
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getInvoiceNumber(): ?string
  27.     {
  28.         return $this->invoiceNumber;
  29.     }
  30.     public function setInvoiceNumber(string $invoiceNumber): self
  31.     {
  32.         $this->invoiceNumber $invoiceNumber;
  33.         return $this;
  34.     }
  35.     public function getIssuedAt(): ?\DateTimeInterface
  36.     {
  37.         return $this->issuedAt;
  38.     }
  39.     public function setIssuedAt(\DateTimeInterface $issuedAt): self
  40.     {
  41.         $this->issuedAt $issuedAt;
  42.         return $this;
  43.     }
  44.     public function getTotal(): ?float
  45.     {
  46.         return $this->total;
  47.     }
  48.     public function setTotal(float $total): self
  49.     {
  50.         $this->total $total;
  51.         return $this;
  52.     }
  53.     public function getOrder(): ?Order
  54.     {
  55.         return $this->order;
  56.     }
  57.     public function setOrder(Order $order): self
  58.     {
  59.         $this->order $order;
  60.         return $this;
  61.     }
  62. }