src/Entity/Profile/PaymentMethod/PaymentGateway.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Profile\PaymentMethod;
  3. use App\Entity\App\PaymentType;
  4. use App\Entity\EntityInterface;
  5. use App\Entity\Profile\Profile;
  6. use App\Repository\Profile\PaymentMethod\PaymentGatewayRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use phpDocumentor\Reflection\Types\Mixed_;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. /**
  11.  * @ORM\Entity(repositoryClass=PaymentGatewayRepository::class)
  12.  * @ORM\Table(name="profile_payment_gateway")
  13.  */
  14. class PaymentGateway implements EntityInterface
  15. {
  16.     /**
  17.      * @ORM\Id()
  18.      * @ORM\GeneratedValue()
  19.      * @ORM\Column(type="integer")
  20.      * @Groups({"paymentGateway:index", "profile:index", "profile:show", "package-transaction:create", "package-transaction:show"})
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="name", type="string", length=200, nullable=false)
  27.      * @Groups({"paymentGateway:index", "profile:index", "profile:show", "paymentGateway:create", "paymentGateway:edit", "package-transaction:create", "package-transaction:show"})
  28.      */
  29.     private $name;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="website", type="string", length=512, nullable=false)
  34.      * @Groups({"paymentGateway:index", "profile:index", "profile:show", "paymentGateway:create", "paymentGateway:edit"})
  35.      */
  36.     private $website;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="provider_params", type="string", length=512, nullable=false)
  41.      * @Groups({"paymentGateway:index", "profile:index", "profile:show", "paymentGateway:create", "paymentGateway:edit"})
  42.      */
  43.     private $providerParams;
  44.     /**
  45.      * @var boolean
  46.      *
  47.      * @ORM\Column(type="boolean", name="status", nullable=false, options={"default":true})
  48.      * @Groups({"paymentGateway:index", "profile:index", "profile:show"})
  49.      */
  50.     private $status true;
  51.     /**
  52.      * @var \DateTime
  53.      *
  54.      * @ORM\Column(name="created_at", type="datetime", nullable=false)
  55.      * @Groups({"paymentGateway:index", "profile:index"})
  56.      */
  57.     private $createdAt;
  58.     /**
  59.      * @ORM\ManyToOne(targetEntity=Profile::class, inversedBy="paymentGateways")
  60.      * @ORM\JoinColumn(nullable=false)
  61.      */
  62.     private $profile;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=PaymentType::class, inversedBy="paymentTypes")
  65.      * @ORM\JoinColumn(nullable=false)
  66.      * @Groups({"paymentGateway:index", "profile:index", "paymentGateway:create", "paymentGateway:edit", "package-transaction:show"})
  67.      */
  68.     private $paymentType;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity=PaymentGatewayEvent::class, mappedBy="paymentGateway")
  71.      * @ORM\JoinColumn(nullable=false)
  72.      * @Groups({"profile:index", "package-transaction:show"})
  73.      */  
  74.     private $events;
  75.     public function __construct()
  76.     {
  77.         $this->createdAt = new \DateTime();
  78.     }
  79.     /**
  80.      * @inheritDoc
  81.      */
  82.     public function getId()
  83.     {
  84.         return $this->id;
  85.     }
  86.     /**
  87.      * @return string
  88.      */
  89.     public function getName(): string
  90.     {
  91.         return $this->name;
  92.     }
  93.     /**
  94.      * @param string $name
  95.      * @return PaymentGateway
  96.      */
  97.     public function setName(string $name): PaymentGateway
  98.     {
  99.         $this->name $name;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return string
  104.      */
  105.     public function getWebsite(): string
  106.     {
  107.         return $this->website;
  108.     }
  109.     /**
  110.      * @param string $website
  111.      * @return PaymentGateway
  112.      */
  113.     public function setWebsite(string $website): PaymentGateway
  114.     {
  115.         $this->website $website;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return mixed
  120.      */
  121.     public function getProviderParams()
  122.     {
  123.         return json_decode($this->providerParamstrue);
  124.     }
  125.     /**
  126.      * @param string $providerParams
  127.      * @return PaymentGateway
  128.      */
  129.     public function setProviderParams(string $providerParams): PaymentGateway
  130.     {
  131.         $this->providerParams $providerParams;
  132.         return $this;
  133.     }
  134.     /**
  135.      * @return bool
  136.      */
  137.     public function isStatus(): bool
  138.     {
  139.         return $this->status;
  140.     }
  141.     /**
  142.      * @param bool $status
  143.      * @return PaymentGateway
  144.      */
  145.     public function setStatus(bool $status): PaymentGateway
  146.     {
  147.         $this->status $status;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return \DateTime
  152.      */
  153.     public function getCreatedAt(): \DateTime
  154.     {
  155.         return $this->createdAt;
  156.     }
  157.     /**
  158.      * @param \DateTime $createdAt
  159.      * @return PaymentGateway
  160.      */
  161.     public function setCreatedAt(\DateTime $createdAt): PaymentGateway
  162.     {
  163.         $this->createdAt $createdAt;
  164.         return $this;
  165.     }
  166.     /**
  167.      * @return Profile
  168.      */
  169.     public function getProfile(): Profile
  170.     {
  171.         return $this->profile;
  172.     }
  173.     /**
  174.      * @param Profile $profile
  175.      * @return PaymentGateway
  176.      */
  177.     public function setProfile(Profile $profile)
  178.     {
  179.         $this->profile $profile;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @return PaymentType
  184.      */
  185.     public function getPaymentType(): PaymentType
  186.     {
  187.         return $this->paymentType;
  188.     }
  189.     /**
  190.      * @param PaymentType $paymentType
  191.      * @return PaymentGateway
  192.      */
  193.     public function setPaymentType(PaymentType $paymentType)
  194.     {
  195.         $this->paymentType $paymentType;
  196.         return $this;
  197.     }
  198.     /**
  199.      * @return mixed
  200.      */
  201.     public function getEvents()
  202.     {
  203.         return $this->events;
  204.     }
  205.     /**
  206.      * @param mixed $events
  207.      * @return PaymentGateway
  208.      */
  209.     public function setEvents($events)
  210.     {
  211.         $this->events $events;
  212.         return $this;
  213.     }
  214. }