src/Entity/UserInvoice.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserInvoiceRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassUserInvoiceRepository::class)]
  7. class UserInvoice
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'userInvoices')]
  14.     #[ORM\JoinColumn(name:"user_id"referencedColumnName"id"nullabletrue)]
  15.     private ?User $user null;
  16.     #[ORM\OneToOne(inversedBy'userInvoice'cascade: ['persist''remove'])]
  17.     #[ORM\JoinColumn(name:"invoice_id"referencedColumnName"invoice_id"nullabletrue)]
  18.     private ?Invoice $invoice null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  20.     private ?\DateTimeInterface $created null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  22.     private ?\DateTimeInterface $updated null;
  23.     #[ORM\Column]
  24.     private ?int $updatedBy null;
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getUser(): ?User
  30.     {
  31.         return $this->user;
  32.     }
  33.     public function setUser(?User $user): static
  34.     {
  35.         $this->user $user;
  36.         return $this;
  37.     }
  38.     public function getInvoice(): ?Invoice
  39.     {
  40.         return $this->invoice;
  41.     }
  42.     public function setInvoice(?Invoice $invoice): self
  43.     {
  44.         $this->invoice $invoice;
  45.         return $this;
  46.     }
  47.     public function getCreated(): ?\DateTimeInterface
  48.     {
  49.         return $this->created;
  50.     }
  51.     public function getUpdated(): ?\DateTimeInterface
  52.     {
  53.         return $this->updated;
  54.     }
  55.     public function getUpdatedBy(): ?int
  56.     {
  57.         return $this->updatedBy;
  58.     }
  59.     public function setUpdatedBy(int $updatedBy): static
  60.     {
  61.         $this->updatedBy $updatedBy;
  62.         return $this;
  63.     }
  64.     public function setCreated(?\DateTimeInterface $created): self
  65.     {
  66.         $this->created $created;
  67.         return $this;
  68.     }
  69.     public function setUpdated(?\DateTimeInterface $updated): void
  70.     {
  71.         $this->updated $updated;
  72.     }
  73. }