src/Entity/Invoice.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InvoiceRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use DateTime;
  6. use DateTimeZone;
  7. /**
  8.  * @ORM\Entity(repositoryClass=InvoiceRepository::class)
  9.  */
  10. class Invoice
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, unique=true, nullable=true)
  20.      */
  21.     private $invoiceNumber;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $status;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      */
  29.     private $createdAt;
  30.     /**
  31.      * @ORM\OneToOne(targetEntity=CreditTransaction::class, inversedBy="invoice")
  32.      * @ORM\JoinColumn(nullable=false)
  33.      */
  34.     private $creditTransaction;
  35.     public function __construct()
  36.     {
  37.         $timezone = new DateTimeZone('Europe/Paris'); 
  38.         $this->createdAt = new DateTime('now'$timezone);
  39.     }
  40.     
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getInvoiceNumber(): ?string
  46.     {
  47.         return $this->invoiceNumber;
  48.     }
  49.     public function setInvoiceNumber(?string $invoiceNumber): self
  50.     {
  51.         $this->invoiceNumber $invoiceNumber;
  52.         return $this;
  53.     }
  54.     public function getStatus(): ?string
  55.     {
  56.         return $this->status;
  57.     }
  58.     public function setStatus(string $status): self
  59.     {
  60.         $this->status $status;
  61.         return $this;
  62.     }
  63.     
  64.     public function getCreatedAt(): ?\DateTimeInterface
  65.     {
  66.         return $this->createdAt;
  67.     }
  68.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  69.     {
  70.         $this->createdAt $createdAt;
  71.         return $this;
  72.     }
  73.     public function getCreditTransaction(): ?CreditTransaction
  74.     {
  75.         return $this->creditTransaction;
  76.     }
  77.     public function setCreditTransaction(?CreditTransaction $creditTransaction): self
  78.     {
  79.         $this->creditTransaction $creditTransaction;
  80.         return $this;
  81.     }
  82. }