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

  1. <?php
  2. namespace App\IlaveU\ShopBundle\Entity\Payment;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\IlaveU\ShopBundle\Entity\Shipping\Vehicle\VehicleRent;
  5. use App\IlaveU\ShopBundle\Repository\Payment\PaymentRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ApiResource]
  8. #[ORM\Entity(repositoryClass: PaymentRepository::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', nullable: true)]
  16.     private ?\DateTimeImmutable $createdAt = null;
  17.     #[ORM\Column(type: 'float')]
  18.     private ?float $amount = null;
  19.     #[ORM\Column(type: 'string', length: 255)]
  20.     private ?string $state = null;
  21.     #[ORM\Column(type: 'text', nullable: true)]
  22.     private ?string $description = null;
  23.     #[ORM\ManyToOne(targetEntity: PaymentMethod::class, inversedBy: 'payments')]
  24.     #[ORM\JoinColumn(nullable: false)]
  25.     private ?\App\IlaveU\ShopBundle\Entity\Payment\PaymentMethod $paymentMethod = null;
  26.     #[ORM\ManyToOne(inversedBy: 'payments')]
  27.     private ?VehicleRent $vehicleRent = null;
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getCreatedAt(): ?\DateTimeImmutable
  33.     {
  34.         return $this->createdAt;
  35.     }
  36.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  37.     {
  38.         $this->createdAt = $createdAt;
  39.         return $this;
  40.     }
  41.     public function getAmount(): ?float
  42.     {
  43.         return $this->amount;
  44.     }
  45.     public function setAmount(float $amount): self
  46.     {
  47.         $this->amount = $amount;
  48.         return $this;
  49.     }
  50.     public function getState(): ?string
  51.     {
  52.         return $this->state;
  53.     }
  54.     public function setState(string $state): self
  55.     {
  56.         $this->state = $state;
  57.         return $this;
  58.     }
  59.     public function getDescription(): ?string
  60.     {
  61.         return $this->description;
  62.     }
  63.     public function setDescription(?string $description): self
  64.     {
  65.         $this->description = $description;
  66.         return $this;
  67.     }
  68.     public function getPaymentMethod(): ?PaymentMethod
  69.     {
  70.         return $this->paymentMethod;
  71.     }
  72.     public function setPaymentMethod(?PaymentMethod $paymentMethod): self
  73.     {
  74.         $this->paymentMethod = $paymentMethod;
  75.         return $this;
  76.     }
  77.     public function getVehicleRent(): ?VehicleRent
  78.     {
  79.         return $this->vehicleRent;
  80.     }
  81.     public function setVehicleRent(?VehicleRent $vehicleRent): self
  82.     {
  83.         $this->vehicleRent = $vehicleRent;
  84.         return $this;
  85.     }
  86. }