src/Entity/Payment.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Base\AbstractTimestampableEntity;
  4. use App\Repository\PaymentRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PaymentRepository::class)
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class Payment extends AbstractTimestampableEntity
  12. {
  13.     /**
  14.      * @ORM\Column(type="string", length=255, nullable=true)
  15.      */
  16.     private $seria;
  17.     /**
  18.      * @ORM\Column(type="integer",nullable=true)
  19.      */
  20.     private $nr;
  21.     /**
  22.      * @ORM\Column(type="date")
  23.      */
  24.     private $date;
  25.     /**
  26.      * @ORM\Column(type="decimal", precision=21, scale=2)
  27.      */
  28.     private $value;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=PaymentType::class, inversedBy="payments")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private $paymenyType;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=FacturiHeader::class, inversedBy="payments")
  36.      * @ORM\JoinColumn(nullable=false)
  37.      */
  38.     private $facturiHeader;
  39.     /**
  40.      * @ORM\OneToOne(targetEntity=CashIn::class, mappedBy="payment", cascade={"persist", "remove"})
  41.      */
  42.     private $cashIn;
  43.     public function __construct()
  44.     {
  45.         $this->facturiHeader = new ArrayCollection();
  46.     }
  47.     public function getSeria(): ?string
  48.     {
  49.         return $this->seria;
  50.     }
  51.     public function setSeria(?string $seria): self
  52.     {
  53.         $this->seria $seria;
  54.         return $this;
  55.     }
  56.     public function getNr(): ?int
  57.     {
  58.         return $this->nr;
  59.     }
  60.     public function setNr(?int $nr): self
  61.     {
  62.         $this->nr $nr;
  63.         return $this;
  64.     }
  65.     public function getDate(): ?\DateTimeInterface
  66.     {
  67.         return $this->date;
  68.     }
  69.     public function setDate(\DateTimeInterface $date): self
  70.     {
  71.         $this->date $date;
  72.         return $this;
  73.     }
  74.     public function getValue(): ?string
  75.     {
  76.         return $this->value;
  77.     }
  78.     public function setValue(string $value): self
  79.     {
  80.         $this->value $value;
  81.         return $this;
  82.     }
  83.     public function getPaymenyType(): ?PaymentType
  84.     {
  85.         return $this->paymenyType;
  86.     }
  87.     public function setPaymenyType(?PaymentType $paymenyType): self
  88.     {
  89.         $this->paymenyType $paymenyType;
  90.         return $this;
  91.     }
  92.     public function getFacturiHeader(): ?FacturiHeader
  93.     {
  94.         return $this->facturiHeader;
  95.     }
  96.     public function setFacturiHeader(?FacturiHeader $facturiHeader): self
  97.     {
  98.         $this->facturiHeader $facturiHeader;
  99.         return $this;
  100.     }
  101.     public function getCashIn(): ?CashIn
  102.     {
  103.         return $this->cashIn;
  104.     }
  105.     public function setCashIn(?CashIn $cashIn): self
  106.     {
  107.         // unset the owning side of the relation if necessary
  108.         if ($cashIn === null && $this->cashIn !== null) {
  109.             $this->cashIn->setPayment(null);
  110.         }
  111.         // set the owning side of the relation if necessary
  112.         if ($cashIn !== null && $cashIn->getPayment() !== $this) {
  113.             $cashIn->setPayment($this);
  114.         }
  115.         $this->cashIn $cashIn;
  116.         return $this;
  117.     }
  118. }