src/Diplix/KMGBundle/Entity/Payment.php line 11

Open in your IDE?
  1. <?php
  2. namespace Diplix\KMGBundle\Entity;
  3. use Diplix\KMGBundle\Util\PayCo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Table(name="payments", indexes={@ORM\Index(name="be_deleted",columns={"be_deleted"})})
  7.  * @ORM\Entity(repositoryClass="Diplix\KMGBundle\Repository\PaymentRepository")
  8.  */
  9. class Payment extends BasicEntity
  10. {
  11.    public const STATUS_NEW 'new';
  12.    public const STATUS_PENDING 'pending';
  13.    public const STATUS_SUCCESS 'success';
  14.    public const STATUS_ERROR 'error';
  15.     /**
  16.      * @ORM\Column(type="integer",name="id")
  17.      * @ORM\Id()
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     protected ?int $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Order", inversedBy="paymentReference" )
  23.      */
  24.     protected Order $order;
  25.     /**
  26.      * @ORM\Column(type="string")
  27.      */
  28.     protected string $service;
  29.     /**
  30.      * @ORM\Column(type="string")
  31.      */
  32.     protected string $status self::STATUS_NEW;
  33.     /**
  34.      * @ORM\Column(type="decimal", nullable=false, precision=12, scale=2,options={"unsigned":false})
  35.      */
  36.     protected float|string $amount 0.0;
  37.     /**
  38.      * @ORM\Column(type="string")
  39.      */
  40.     protected string $currency "EUR";
  41.     /////////////////////////////////////////////////////////////////////////////////////////////////////
  42.     public function getId(): int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getOrder(): Order
  47.     {
  48.         return $this->order;
  49.     }
  50.     public function setOrder(Order $order): void
  51.     {
  52.         $this->order $order;
  53.     }
  54.     /**
  55.      * @return mixed
  56.      */
  57.     public function getService()
  58.     {
  59.         return $this->service;
  60.     }
  61.     /**
  62.      * @param mixed $service
  63.      */
  64.     public function setService($service): void
  65.     {
  66.         $this->service $service;
  67.     }
  68.     public function getStatus(): int
  69.     {
  70.         return $this->status;
  71.     }
  72.     public function setStatus(int $status): void
  73.     {
  74.         $this->status $status;
  75.     }
  76.     public function getAmount(): float
  77.     {
  78.         return $this->amount;
  79.     }
  80.     public function setAmount(float $amount): void
  81.     {
  82.         $this->amount $amount;
  83.     }
  84.     public function getCurrency(): string
  85.     {
  86.         return $this->currency;
  87.     }
  88.     public function setCurrency(string $currency): void
  89.     {
  90.         $this->currency $currency;
  91.     }
  92. }