<?php
namespace App\Entity\Profile\PaymentMethod;
use App\Entity\App\PaymentType;
use App\Entity\EntityInterface;
use App\Entity\Profile\Profile;
use App\Repository\Profile\PaymentMethod\PaymentGatewayRepository;
use Doctrine\ORM\Mapping as ORM;
use phpDocumentor\Reflection\Types\Mixed_;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=PaymentGatewayRepository::class)
* @ORM\Table(name="profile_payment_gateway")
*/
class PaymentGateway implements EntityInterface
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
* @Groups({"paymentGateway:index", "profile:index", "profile:show", "package-transaction:create", "package-transaction:show"})
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=200, nullable=false)
* @Groups({"paymentGateway:index", "profile:index", "profile:show", "paymentGateway:create", "paymentGateway:edit", "package-transaction:create", "package-transaction:show"})
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="website", type="string", length=512, nullable=false)
* @Groups({"paymentGateway:index", "profile:index", "profile:show", "paymentGateway:create", "paymentGateway:edit"})
*/
private $website;
/**
* @var string
*
* @ORM\Column(name="provider_params", type="string", length=512, nullable=false)
* @Groups({"paymentGateway:index", "profile:index", "profile:show", "paymentGateway:create", "paymentGateway:edit"})
*/
private $providerParams;
/**
* @var boolean
*
* @ORM\Column(type="boolean", name="status", nullable=false, options={"default":true})
* @Groups({"paymentGateway:index", "profile:index", "profile:show"})
*/
private $status = true;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
* @Groups({"paymentGateway:index", "profile:index"})
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=Profile::class, inversedBy="paymentGateways")
* @ORM\JoinColumn(nullable=false)
*/
private $profile;
/**
* @ORM\ManyToOne(targetEntity=PaymentType::class, inversedBy="paymentTypes")
* @ORM\JoinColumn(nullable=false)
* @Groups({"paymentGateway:index", "profile:index", "paymentGateway:create", "paymentGateway:edit", "package-transaction:show"})
*/
private $paymentType;
/**
* @ORM\OneToMany(targetEntity=PaymentGatewayEvent::class, mappedBy="paymentGateway")
* @ORM\JoinColumn(nullable=false)
* @Groups({"profile:index", "package-transaction:show"})
*/
private $events;
public function __construct()
{
$this->createdAt = new \DateTime();
}
/**
* @inheritDoc
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
* @return PaymentGateway
*/
public function setName(string $name): PaymentGateway
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getWebsite(): string
{
return $this->website;
}
/**
* @param string $website
* @return PaymentGateway
*/
public function setWebsite(string $website): PaymentGateway
{
$this->website = $website;
return $this;
}
/**
* @return mixed
*/
public function getProviderParams()
{
return json_decode($this->providerParams, true);
}
/**
* @param string $providerParams
* @return PaymentGateway
*/
public function setProviderParams(string $providerParams): PaymentGateway
{
$this->providerParams = $providerParams;
return $this;
}
/**
* @return bool
*/
public function isStatus(): bool
{
return $this->status;
}
/**
* @param bool $status
* @return PaymentGateway
*/
public function setStatus(bool $status): PaymentGateway
{
$this->status = $status;
return $this;
}
/**
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* @param \DateTime $createdAt
* @return PaymentGateway
*/
public function setCreatedAt(\DateTime $createdAt): PaymentGateway
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Profile
*/
public function getProfile(): Profile
{
return $this->profile;
}
/**
* @param Profile $profile
* @return PaymentGateway
*/
public function setProfile(Profile $profile)
{
$this->profile = $profile;
return $this;
}
/**
* @return PaymentType
*/
public function getPaymentType(): PaymentType
{
return $this->paymentType;
}
/**
* @param PaymentType $paymentType
* @return PaymentGateway
*/
public function setPaymentType(PaymentType $paymentType)
{
$this->paymentType = $paymentType;
return $this;
}
/**
* @return mixed
*/
public function getEvents()
{
return $this->events;
}
/**
* @param mixed $events
* @return PaymentGateway
*/
public function setEvents($events)
{
$this->events = $events;
return $this;
}
}