src\Entity\MpesaTransactionVerification.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MpesaTransactionVerificationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JMS\Serializer\Annotation as Serializer;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use Symfony\Component\Serializer\Annotation\Ignore;
  10. use JMS\Serializer\Annotation\Exclude;
  11. /**
  12.  * @ORM\Entity(repositoryClass=MpesaTransactionVerificationRepository::class)
  13.  * @UniqueEntity("transactionId")
  14.  * @ORM\Table(name = "neema.mpesa_transaction_verification")
  15.  */
  16. class MpesaTransactionVerification
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", length=50)
  26.      */
  27.     private $transactionType;
  28.     /**
  29.      *
  30.      * @ORM\Column(type="string", length=12, unique=true)
  31.      */
  32.     private $transactionId;
  33.     // 2019-11-09 00:00:00
  34.     /**
  35.      *
  36.      * @Serializer\Type("DateTime<'Y-m-d H:i:s'>")
  37.      * @ORM\Column(type="datetime")
  38.      */
  39.     private $transactionTime;
  40.     /**
  41.      * @ORM\Column(type="float")
  42.      */
  43.     private $transactionAmount;
  44.     /**
  45.      * @ORM\Column(type="integer")
  46.      */
  47.     private $shortCode;
  48.     /**
  49.      * @ORM\Column(type="string", length=20)
  50.      */
  51.     private $billReferenceNumber;
  52.     /**
  53.      * @ORM\Column(type="string", length=20, nullable=true)
  54.      */
  55.     private $invoiceNumber;
  56.     /**
  57.      * @ORM\Column(type="float")
  58.      */
  59.     private $accountBalance;
  60.     /**
  61.      * @ORM\Column(type="string", length=20, nullable=true)
  62.      */
  63.     private $thirdPartyTransactionId;
  64.     /**
  65.      * @ORM\Column(type="string", length=20)
  66.      */
  67.     private $msisdn;
  68.     /**
  69.      * @ORM\Column(type="string", length=50, nullable=true)
  70.      */
  71.     private $firstName;
  72.     /**
  73.      * @ORM\Column(type="string", length=50, nullable=true)
  74.      */
  75.     private $middleName;
  76.     /**
  77.      * @ORM\Column(type="string", length=50, nullable=true)
  78.      */
  79.     private $lastName;
  80.     /**
  81.      * @ORM\Column(type="boolean")
  82.      */
  83.     private $isComplete;
  84.     /**
  85.      * @Serializer\Type("DateTime<'Y-m-d H:i:s'>")
  86.      * @ORM\Column(type="datetime", options={"default": "CURRENT_TIMESTAMP"}, nullable=true)
  87.      */
  88.     private $createdAt;
  89.     /**
  90.      * @ORM\Column(type="boolean")
  91.      */
  92.     private $isUsed;
  93.     /**
  94.      * @ORM\Column(type="boolean")
  95.      */
  96.     private $isSeen;
  97.     /**
  98.      * @ORM\Column(type="datetime", nullable=true)
  99.      */
  100.     private $readAt;
  101.     /**
  102.      * @ORM\Column(type="datetime", nullable=true)
  103.      */
  104.     private $usedAt;
  105.     /**
  106.      * @ORM\Column(type="datetime", nullable=true)
  107.      */
  108.     private $completedAt;
  109.     /**
  110.      * @ORM\Column(type="string", length=16, nullable=true)
  111.      */
  112.     private $seenFromIp;
  113.     /**
  114.      * @ORM\Column(type="string", length=16, nullable=true)
  115.      */
  116.     private $mpesaFromIp;
  117.     /**
  118.      * @ORM\Column(type="string", length=16, nullable=true)
  119.      */
  120.     private $completedMpesaFromIp;
  121.     /**
  122.      * @ORM\Column(type="boolean")
  123.      */
  124.     private $isValidated;
  125.     /**
  126.      * @Exclude()
  127.      * @ORM\OneToMany(targetEntity=MpesaManual::class, mappedBy="mpesaTransaction")
  128.      */
  129.     private $createdBy;
  130.     /**
  131.      * @Exclude()
  132.      * @ORM\OneToMany(targetEntity=MpesaManual::class, mappedBy="mpesaTransaction")
  133.      */
  134.     private $mpesaManuals;
  135.     public function __construct()
  136.     {
  137.         $this->createdBy = new ArrayCollection();
  138.         $this->mpesaManuals = new ArrayCollection();
  139.     }
  140.     public function getId(): ?int
  141.     {
  142.         return $this->id;
  143.     }
  144.     public function getTransactionType(): ?string
  145.     {
  146.         return $this->transactionType;
  147.     }
  148.     public function setTransactionType(string $transactionType): self
  149.     {
  150.         $this->transactionType $transactionType;
  151.         return $this;
  152.     }
  153.     public function getTransactionId(): ?string
  154.     {
  155.         return $this->transactionId;
  156.     }
  157.     public function setTransactionId(string $transactionId): self
  158.     {
  159.         $this->transactionId $transactionId;
  160.         return $this;
  161.     }
  162.     public function getTransactionTime(): ?\DateTimeInterface
  163.     {
  164.         return $this->transactionTime;
  165.     }
  166.     public function setTransactionTime(\DateTimeInterface $transactionTime): self
  167.     {
  168.         $this->transactionTime $transactionTime;
  169.         return $this;
  170.     }
  171.     public function getTransactionAmount(): ?float
  172.     {
  173.         return $this->transactionAmount;
  174.     }
  175.     public function setTransactionAmount(float $transactionAmount): self
  176.     {
  177.         $this->transactionAmount $transactionAmount;
  178.         return $this;
  179.     }
  180.     public function getShortCode(): ?int
  181.     {
  182.         return $this->shortCode;
  183.     }
  184.     public function setShortCode(int $shortCode): self
  185.     {
  186.         $this->shortCode $shortCode;
  187.         return $this;
  188.     }
  189.     public function getBillReferenceNumber(): ?string
  190.     {
  191.         return $this->billReferenceNumber;
  192.     }
  193.     public function setBillReferenceNumber(string $billReferenceNumber): self
  194.     {
  195.         $this->billReferenceNumber $billReferenceNumber;
  196.         return $this;
  197.     }
  198.     public function getInvoiceNumber(): ?string
  199.     {
  200.         return $this->invoiceNumber;
  201.     }
  202.     public function setInvoiceNumber(?string $invoiceNumber): self
  203.     {
  204.         $this->invoiceNumber $invoiceNumber;
  205.         return $this;
  206.     }
  207.     public function getAccountBalance(): ?float
  208.     {
  209.         return $this->accountBalance;
  210.     }
  211.     public function setAccountBalance(float $accountBalance): self
  212.     {
  213.         $this->accountBalance $accountBalance;
  214.         return $this;
  215.     }
  216.     public function getThirdPartyTransactionId(): ?string
  217.     {
  218.         return $this->thirdPartyTransactionId;
  219.     }
  220.     public function setThirdPartyTransactionId(?string $thirdPartyTransactionId): self
  221.     {
  222.         $this->thirdPartyTransactionId $thirdPartyTransactionId;
  223.         return $this;
  224.     }
  225.     public function getMsisdn(): ?string
  226.     {
  227.         return $this->msisdn;
  228.     }
  229.     public function setMsisdn(string $msisdn): self
  230.     {
  231.         $this->msisdn $msisdn;
  232.         return $this;
  233.     }
  234.     public function getFirstName(): ?string
  235.     {
  236.         return $this->firstName;
  237.     }
  238.     public function setFirstName(?string $firstName): self
  239.     {
  240.         $this->firstName $firstName;
  241.         return $this;
  242.     }
  243.     public function getMiddleName(): ?string
  244.     {
  245.         return $this->middleName;
  246.     }
  247.     public function setMiddleName(?string $middleName): self
  248.     {
  249.         $this->middleName $middleName;
  250.         return $this;
  251.     }
  252.     public function getLastName(): ?string
  253.     {
  254.         return $this->lastName;
  255.     }
  256.     public function setLastName(?string $lastName): self
  257.     {
  258.         $this->lastName $lastName;
  259.         return $this;
  260.     }
  261.     public function getIsComplete(): ?bool
  262.     {
  263.         return $this->isComplete;
  264.     }
  265.     public function setIsComplete(bool $isComplete): self
  266.     {
  267.         $this->isComplete $isComplete;
  268.         return $this;
  269.     }
  270.     public function getCreatedAt(): ?\DateTime
  271.     {
  272.         return $this->createdAt;
  273.     }
  274.     public function setCreatedAt(\DateTime $createdAt): self
  275.     {
  276.         $this->createdAt $createdAt;
  277.         return $this;
  278.     }
  279.     public function getIsUsed(): ?bool
  280.     {
  281.         return $this->isUsed;
  282.     }
  283.     public function setIsUsed(bool $isUsed): self
  284.     {
  285.         $this->isUsed $isUsed;
  286.         return $this;
  287.     }
  288.     public function getIsSeen(): ?bool
  289.     {
  290.         return $this->isSeen;
  291.     }
  292.     public function setIsSeen(bool $isSeen): self
  293.     {
  294.         $this->isSeen $isSeen;
  295.         return $this;
  296.     }
  297.     public function getReadAt(): ?\DateTimeInterface
  298.     {
  299.         return $this->readAt;
  300.     }
  301.     public function setReadAt(?\DateTimeInterface $readAt): self
  302.     {
  303.         $this->readAt $readAt;
  304.         return $this;
  305.     }
  306.     public function getUsedAt(): ?\DateTimeInterface
  307.     {
  308.         return $this->usedAt;
  309.     }
  310.     public function setUsedAt(?\DateTimeInterface $usedAt): self
  311.     {
  312.         $this->usedAt $usedAt;
  313.         return $this;
  314.     }
  315.     public function getCompletedAt(): ?\DateTimeInterface
  316.     {
  317.         return $this->completedAt;
  318.     }
  319.     public function setCompletedAt(?\DateTimeInterface $completedAt): self
  320.     {
  321.         $this->completedAt $completedAt;
  322.         return $this;
  323.     }
  324.     public function getSeenFromIp(): ?string
  325.     {
  326.         return $this->seenFromIp;
  327.     }
  328.     public function setSeenFromIp(string $seenFromIp): self
  329.     {
  330.         $this->seenFromIp $seenFromIp;
  331.         return $this;
  332.     }
  333.     public function getMpesaFromIp(): ?string
  334.     {
  335.         return $this->mpesaFromIp;
  336.     }
  337.     public function setMpesaFromIp(string $mpesaFromIp): self
  338.     {
  339.         $this->mpesaFromIp $mpesaFromIp;
  340.         return $this;
  341.     }
  342.     public function getCompletedMpesaFromIp(): ?string
  343.     {
  344.         return $this->completedMpesaFromIp;
  345.     }
  346.     public function setCompletedMpesaFromIp(?string $completedMpesaFromIp): self
  347.     {
  348.         $this->completedMpesaFromIp $completedMpesaFromIp;
  349.         return $this;
  350.     }
  351.     public function getIsValidated(): ?bool
  352.     {
  353.         return $this->isValidated;
  354.     }
  355.     public function setIsValidated(bool $isValidated): self
  356.     {
  357.         $this->isValidated $isValidated;
  358.         return $this;
  359.     }
  360.     /**
  361.      * @return Collection|MpesaManual[]
  362.      */
  363.     public function getCreatedBy(): Collection
  364.     {
  365.         return $this->createdBy;
  366.     }
  367.     public function addCreatedBy(MpesaManual $createdBy): self
  368.     {
  369.         if (!$this->createdBy->contains($createdBy)) {
  370.             $this->createdBy[] = $createdBy;
  371.             $createdBy->setMpesaTransaction($this);
  372.         }
  373.         return $this;
  374.     }
  375.     public function removeCreatedBy(MpesaManual $createdBy): self
  376.     {
  377.         if ($this->createdBy->removeElement($createdBy)) {
  378.             // set the owning side to null (unless already changed)
  379.             if ($createdBy->getMpesaTransaction() === $this) {
  380.                 $createdBy->setMpesaTransaction(null);
  381.             }
  382.         }
  383.         return $this;
  384.     }
  385.     /**
  386.      * 
  387.      *
  388.      * @return Collection|MpesaManual[]
  389.      */
  390.     public function getMpesaManuals(): Collection
  391.     {
  392.         return $this->mpesaManuals;
  393.     }
  394.     public function addMpesaManual(MpesaManual $mpesaManual): self
  395.     {
  396.         if (!$this->mpesaManuals->contains($mpesaManual)) {
  397.             $this->mpesaManuals[] = $mpesaManual;
  398.             $mpesaManual->setMpesaTransaction($this);
  399.         }
  400.         return $this;
  401.     }
  402.     public function removeMpesaManual(MpesaManual $mpesaManual): self
  403.     {
  404.         if ($this->mpesaManuals->removeElement($mpesaManual)) {
  405.             // set the owning side to null (unless already changed)
  406.             if ($mpesaManual->getMpesaTransaction() === $this) {
  407.                 $mpesaManual->setMpesaTransaction(null);
  408.             }
  409.         }
  410.         return $this;
  411.     }
  412. }