lib/WitsPaymentBundle/src/Entity/PaymentMethod.php line 12

Open in your IDE?
  1. <?php
  2. namespace Wits\PaymentBundle\Entity;
  3. use App\Entity\User;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=Wits\PaymentBundle\Repository\PaymentMethodRepository::class)
  8.  */
  9. class PaymentMethod
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private int $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=10)
  19.      */
  20.     private string $type;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private ?string $stripeId=null;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private ?string $description=null;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="paymentMethods")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private User $user;
  34.     /**
  35.      * @ORM\Column(type="datetime", nullable=true)
  36.      * @var DateTime|null
  37.      */
  38.     private ?DateTime $expireAt=null;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      * @var DateTime|null
  42.      */
  43.     private ?DateTime $userNotifiedOfExpirationAt=null;
  44.     /**
  45.      * @var boolean
  46.      * @ORM\Column(type="boolean", options={"default" : true})
  47.      */
  48.     private bool $valid=true;
  49.     public function getLabel(): string
  50.     {
  51.         return $this->type ' | ' $this->stripeId;
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getType(): ?string
  58.     {
  59.         return $this->type;
  60.     }
  61.     public function setType(string $type): self
  62.     {
  63.         $this->type $type;
  64.         return $this;
  65.     }
  66.     public function getStripeId(): ?string
  67.     {
  68.         return $this->stripeId;
  69.     }
  70.     public function setStripeId(?string $stripeId): self
  71.     {
  72.         $this->stripeId $stripeId;
  73.         return $this;
  74.     }
  75.     public function getUser(): ?User
  76.     {
  77.         return $this->user;
  78.     }
  79.     public function setUser(?User $user): self
  80.     {
  81.         $this->user $user;
  82.         return $this;
  83.     }
  84.     public function getDescription(): ?string
  85.     {
  86.         return $this->description;
  87.     }
  88.     /**
  89.      * @param mixed $description
  90.      */
  91.     public function setDescription($description): void
  92.     {
  93.         $this->description $description;
  94.     }
  95.     public function getExpireAt(): ?DateTime
  96.     {
  97.         return $this->expireAt;
  98.     }
  99.     public function setExpireAt(?DateTime $expireAt): void
  100.     {
  101.         $this->expireAt $expireAt;
  102.     }
  103.     public function getUserNotifiedOfExpirationAt(): ?DateTime
  104.     {
  105.         return $this->userNotifiedOfExpirationAt;
  106.     }
  107.     public function setUserNotifiedOfExpirationAt(?DateTime $userNotifiedOfExpirationAt): void
  108.     {
  109.         $this->userNotifiedOfExpirationAt $userNotifiedOfExpirationAt;
  110.     }
  111.     public function isValid(): bool
  112.     {
  113.         return $this->valid;
  114.     }
  115.     public function expire(): void
  116.     {
  117.         $this->valid false;
  118.     }
  119. }