src/Flexy/ShopBundle/Entity/Payment/Payment.php line 12

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Payment;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Flexy\ShopBundle\Entity\Order\Order;
  5. use App\Flexy\ShopBundle\Repository\Payment\PaymentRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ApiResource]
  8. #[ORM\Entity(repositoryClassPaymentRepository::class)]
  9. class Payment
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  16.     private ?\DateTimeImmutable $createdAt null;
  17.     #[ORM\Column(type'float')]
  18.     private ?float $amount null;
  19.     #[ORM\Column(type'string'length255nullabletrue)]
  20.     private ?string $state null;
  21.     #[ORM\Column(type'text'nullabletrue)]
  22.     private ?string $description null;
  23.     #[ORM\ManyToOne(targetEntityPaymentMethod::class, inversedBy'payments')]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private ?\App\Flexy\ShopBundle\Entity\Payment\PaymentMethod $paymentMethod null;
  26.     #[ORM\ManyToOne(inversedBy'payments')]
  27.     private ?Order $relatedOrder null;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $payerFirstName null;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $payerLastName null;
  32.     #[ORM\Column(length255nullabletrue)]
  33.     private ?string $bankName null;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $bankAccountNumber null;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $reference null;
  38.     public function __toString()
  39.     {
  40.         return $this->amount ." (".$this->paymentMethod.")";
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getCreatedAt(): ?\DateTimeImmutable
  47.     {
  48.         return $this->createdAt;
  49.     }
  50.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  51.     {
  52.         $this->createdAt $createdAt;
  53.         return $this;
  54.     }
  55.     public function getAmount(): ?float
  56.     {
  57.         return $this->amount;
  58.     }
  59.     public function setAmount(float $amount): self
  60.     {
  61.         $this->amount $amount;
  62.         return $this;
  63.     }
  64.     public function getState(): ?string
  65.     {
  66.         return $this->state;
  67.     }
  68.     public function setState(string $state): self
  69.     {
  70.         $this->state $state;
  71.         return $this;
  72.     }
  73.     public function getDescription(): ?string
  74.     {
  75.         return $this->description;
  76.     }
  77.     public function setDescription(?string $description): self
  78.     {
  79.         $this->description $description;
  80.         return $this;
  81.     }
  82.     public function getPaymentMethod(): ?PaymentMethod
  83.     {
  84.         return $this->paymentMethod;
  85.     }
  86.     public function setPaymentMethod(?PaymentMethod $paymentMethod): self
  87.     {
  88.         $this->paymentMethod $paymentMethod;
  89.         return $this;
  90.     }
  91.     public function getRelatedOrder(): ?Order
  92.     {
  93.         return $this->relatedOrder;
  94.     }
  95.     public function setRelatedOrder(?Order $relatedOrder): self
  96.     {
  97.         $this->relatedOrder $relatedOrder;
  98.         return $this;
  99.     }
  100.     public function getPayerFirstName(): ?string
  101.     {
  102.         return $this->payerFirstName;
  103.     }
  104.     public function setPayerFirstName(?string $payerFirstName): self
  105.     {
  106.         $this->payerFirstName $payerFirstName;
  107.         return $this;
  108.     }
  109.     public function getPayerLastName(): ?string
  110.     {
  111.         return $this->payerLastName;
  112.     }
  113.     public function setPayerLastName(?string $payerLastName): self
  114.     {
  115.         $this->payerLastName $payerLastName;
  116.         return $this;
  117.     }
  118.     public function getBankName(): ?string
  119.     {
  120.         return $this->bankName;
  121.     }
  122.     public function setBankName(?string $bankName): self
  123.     {
  124.         $this->bankName $bankName;
  125.         return $this;
  126.     }
  127.     public function getBankAccountNumber(): ?string
  128.     {
  129.         return $this->bankAccountNumber;
  130.     }
  131.     public function setBankAccountNumber(?string $bankAccountNumber): self
  132.     {
  133.         $this->bankAccountNumber $bankAccountNumber;
  134.         return $this;
  135.     }
  136.     public function getReference(): ?string
  137.     {
  138.         return $this->reference;
  139.     }
  140.     public function setReference(?string $reference): self
  141.     {
  142.         $this->reference $reference;
  143.         return $this;
  144.     }
  145. }