src/Entity/MobileAppPackageSold.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Constant\PaymentMethod;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. /**
  11.  * MobileAppPackageSold
  12.  *
  13.  * @ORM\Table(name="mobile_app_package_sold")
  14.  * @ORM\Entity(repositoryClass="App\Repository\MobileAppPackageSoldRepository")
  15.  * @ORM\HasLifecycleCallbacks()
  16.  */
  17. class MobileAppPackageSold
  18. {
  19.     /**
  20.      * @var int
  21.      *
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      * @Groups({"package_sold"})
  26.      */
  27.     private $id;
  28.     /**
  29.      * @var int
  30.      *
  31.      * @ORM\Column(name="packet_id", type="integer", nullable=true)
  32.      */
  33.     private $packetId;
  34.     /**
  35.      * @var int
  36.      *
  37.      * @ORM\Column(name="eid", type="integer")
  38.      * @Groups({"package_sold"})
  39.      */
  40.     private $eid;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(name="price", type="string", length=255)
  45.      * @Groups({"package_sold"})
  46.      */
  47.     private $price;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\Column(name="quantity", type="string", length=255)
  52.      */
  53.     private $quantity;
  54.     /**
  55.      * @var int
  56.      *
  57.      * @ORM\Column(name="user_id", type="integer")
  58.      * @Groups({"package_sold"})
  59.      */
  60.     private $userId;
  61.     /**
  62.      * @var int
  63.      *
  64.      * @ORM\Column(name="attendant_id", type="integer")
  65.      */
  66.     private $attendantId;
  67.     /**
  68.      * @var string
  69.      *
  70.      * @ORM\Column(name="locator", type="string", length=255)
  71.      * @Groups({"package_sold"})
  72.      */
  73.     private $locator;
  74.     /**
  75.      * @var \DateTime
  76.      *
  77.      * @ORM\Column(name="created_at", type="datetime")
  78.      */
  79.     private $createdAt;
  80.     /**
  81.      * @var string
  82.      *
  83.      * @ORM\Column(name="time_payment", type="string", length=255, nullable=true)
  84.      */
  85.     private $timePayment;
  86.     /**
  87.      * @var string
  88.      *
  89.      * @ORM\Column(name="amount_payment", type="string", length=255, nullable=true)
  90.      * @Groups({"package_sold"})
  91.      */
  92.     private $amountPayment;
  93.     /**
  94.      * @var string
  95.      *
  96.      * @ORM\Column(name="order_payment", type="string", length=255, nullable=true)
  97.      * @Groups({"package_sold"})
  98.      */
  99.     private $orderPayment;
  100.     /**
  101.      * @var string
  102.      *
  103.      * @ORM\Column(name="response_payment", type="string", length=255, nullable=true)
  104.      * @Groups({"package_sold"})
  105.      */
  106.     private $responsePayment;
  107.     /**
  108.      * @var string
  109.      *
  110.      * @ORM\Column(name="authorisationCode_payment", type="string", length=255, nullable=true)
  111.      * @Groups({"package_sold"})
  112.      */
  113.     private $authorisationCodePayment;
  114.     /**
  115.      * @var string
  116.      *
  117.      * @ORM\Column(name="date_payment", type="string", length=255, nullable=true)
  118.      * @Groups({"package_sold"})
  119.      */
  120.     private $datePayment;
  121.     /**
  122.      * @var string
  123.      *
  124.      * @ORM\Column(name="estatus_payment", type="string", length=255, nullable=true)
  125.      * @Groups({"package_sold"})
  126.      */
  127.     private $estatusPayment "pending";
  128.     /**
  129.      * @ORM\OneToMany(targetEntity=SoldPackagesSales::class, mappedBy="mobileAppPackageSold", orphanRemoval=true, cascade={"persist"})
  130.      * @Groups({"package_sold"})
  131.      */
  132.     private $soldPackagesSales;
  133.     /**
  134.      * @ORM\Column(type="string", length=50)
  135.      * @Assert\Choice(callback={"App\Constant\PaymentMethod", "getAvailableTypes"}, message="Invalid payment method.")
  136.      * @Groups({"package_sold"})
  137.      */
  138.     private $method;
  139.     /**
  140.      * @ORM\OneToMany(targetEntity=AppMobileGuest::class, mappedBy="packageSold")
  141.      */
  142.     private $appMobileGuests;
  143.     public function __construct()
  144.     {
  145.         $this->soldPackagesSales = new ArrayCollection();
  146.         $this->appMobileGuests = new ArrayCollection();
  147.     }
  148.     /**
  149.      * Get id
  150.      *
  151.      * @return integer
  152.      */
  153.     public function getId()
  154.     {
  155.         return $this->id;
  156.     }
  157.     /**
  158.      * Set packetId
  159.      *
  160.      * @param integer $packetId
  161.      *
  162.      * @return MobileAppPackageSold
  163.      */
  164.     public function setPacketId($packetId)
  165.     {
  166.         $this->packetId $packetId;
  167.     
  168.         return $this;
  169.     }
  170.     /**
  171.      * Get packetId
  172.      *
  173.      * @return integer
  174.      */
  175.     public function getPacketId()
  176.     {
  177.         return $this->packetId;
  178.     }
  179.     /**
  180.      * Set eid
  181.      *
  182.      * @param integer $eid
  183.      *
  184.      * @return MobileAppPackageSold
  185.      */
  186.     public function setEid($eid)
  187.     {
  188.         $this->eid $eid;
  189.     
  190.         return $this;
  191.     }
  192.     /**
  193.      * Get eid
  194.      *
  195.      * @return integer
  196.      */
  197.     public function getEid()
  198.     {
  199.         return $this->eid;
  200.     }
  201.     /**
  202.      * Set price
  203.      *
  204.      * @param string $price
  205.      *
  206.      * @return MobileAppPackageSold
  207.      */
  208.     public function setPrice($price)
  209.     {
  210.         $this->price $price;
  211.     
  212.         return $this;
  213.     }
  214.     /**
  215.      * Get price
  216.      *
  217.      * @return string
  218.      */
  219.     public function getPrice()
  220.     {
  221.         return $this->price;
  222.     }
  223.     /**
  224.      * Set quantity
  225.      *
  226.      * @param string $quantity
  227.      *
  228.      * @return MobileAppPackageSold
  229.      */
  230.     public function setQuantity($quantity)
  231.     {
  232.         $this->quantity $quantity;
  233.     
  234.         return $this;
  235.     }
  236.     /**
  237.      * Get quantity
  238.      *
  239.      * @return string
  240.      */
  241.     public function getQuantity()
  242.     {
  243.         return $this->quantity;
  244.     }
  245.     /**
  246.      * Set userId
  247.      *
  248.      * @param integer $userId
  249.      *
  250.      * @return MobileAppPackageSold
  251.      */
  252.     public function setUserId($userId)
  253.     {
  254.         $this->userId $userId;
  255.     
  256.         return $this;
  257.     }
  258.     /**
  259.      * Get userId
  260.      *
  261.      * @return integer
  262.      */
  263.     public function getUserId()
  264.     {
  265.         return $this->userId;
  266.     }
  267.     /**
  268.      * Set attendantId
  269.      *
  270.      * @param integer $attendantId
  271.      *
  272.      * @return MobileAppPackageSold
  273.      */
  274.     public function setAttendantId($attendantId)
  275.     {
  276.         $this->attendantId $attendantId;
  277.     
  278.         return $this;
  279.     }
  280.     /**
  281.      * Get attendantId
  282.      *
  283.      * @return integer
  284.      */
  285.     public function getAttendantId()
  286.     {
  287.         return $this->attendantId;
  288.     }
  289.     /**
  290.      * Set locator
  291.      *
  292.      * @param string $locator
  293.      *
  294.      * @return MobileAppPackageSold
  295.      */
  296.     public function setLocator($locator)
  297.     {
  298.         $this->locator $locator;
  299.     
  300.         return $this;
  301.     }
  302.     /**
  303.      * Get locator
  304.      *
  305.      * @return string
  306.      */
  307.     public function getLocator()
  308.     {
  309.         return $this->locator;
  310.     }
  311.     /**
  312.      * Set createdAt
  313.      *
  314.      * @param \DateTime $createdAt
  315.      *
  316.      * @return MobileAppPackageSold
  317.      */
  318.     public function setCreatedAt(\Datetime $createdAt)
  319.     {
  320.         $this->createdAt $createdAt;
  321.     
  322.         return $this;
  323.     }
  324.     /**
  325.      * Get createdAt
  326.      *
  327.      * @return \DateTime
  328.      */
  329.     public function getCreatedAt()
  330.     {
  331.         return $this->createdAt;
  332.     }
  333.     /**
  334.      * Set timePayment
  335.      *
  336.      * @param string $timePayment
  337.      *
  338.      * @return MobileAppPackageSold
  339.      */
  340.     public function setTimePayment($timePayment)
  341.     {
  342.         $this->timePayment $timePayment;
  343.     
  344.         return $this;
  345.     }
  346.     /**
  347.      * Get timePayment
  348.      *
  349.      * @return string
  350.      */
  351.     public function getTimePayment()
  352.     {
  353.         return $this->timePayment;
  354.     }
  355.     /**
  356.      * Set amountPayment
  357.      *
  358.      * @param string $amountPayment
  359.      *
  360.      * @return MobileAppPackageSold
  361.      */
  362.     public function setAmountPayment($amountPayment)
  363.     {
  364.         $this->amountPayment $amountPayment;
  365.     
  366.         return $this;
  367.     }
  368.     /**
  369.      * Get amountPayment
  370.      *
  371.      * @return string
  372.      */
  373.     public function getAmountPayment()
  374.     {
  375.         return $this->amountPayment;
  376.     }
  377.     /**
  378.      * Set orderPayment
  379.      *
  380.      * @param string $orderPayment
  381.      *
  382.      * @return MobileAppPackageSold
  383.      */
  384.     public function setOrderPayment($orderPayment)
  385.     {
  386.         $this->orderPayment $orderPayment;
  387.     
  388.         return $this;
  389.     }
  390.     /**
  391.      * Get orderPayment
  392.      *
  393.      * @return string
  394.      */
  395.     public function getOrderPayment()
  396.     {
  397.         return $this->orderPayment;
  398.     }
  399.     /**
  400.      * Set responsePayment
  401.      *
  402.      * @param string $responsePayment
  403.      *
  404.      * @return MobileAppPackageSold
  405.      */
  406.     public function setResponsePayment($responsePayment)
  407.     {
  408.         $this->responsePayment $responsePayment;
  409.     
  410.         return $this;
  411.     }
  412.     /**
  413.      * Get responsePayment
  414.      *
  415.      * @return string
  416.      */
  417.     public function getResponsePayment()
  418.     {
  419.         return $this->responsePayment;
  420.     }
  421.     /**
  422.      * Set authorisationCodePayment
  423.      *
  424.      * @param string $authorisationCodePayment
  425.      *
  426.      * @return MobileAppPackageSold
  427.      */
  428.     public function setAuthorisationCodePayment($authorisationCodePayment)
  429.     {
  430.         $this->authorisationCodePayment $authorisationCodePayment;
  431.     
  432.         return $this;
  433.     }
  434.     /**
  435.      * Get authorisationCodePayment
  436.      *
  437.      * @return string
  438.      */
  439.     public function getAuthorisationCodePayment()
  440.     {
  441.         return $this->authorisationCodePayment;
  442.     }
  443.     /**
  444.      * Set datePayment
  445.      *
  446.      * @param string $datePayment
  447.      *
  448.      * @return MobileAppPackageSold
  449.      */
  450.     public function setDatePayment($datePayment)
  451.     {
  452.         $this->datePayment $datePayment;
  453.     
  454.         return $this;
  455.     }
  456.     /**
  457.      * Get datePayment
  458.      *
  459.      * @return string
  460.      */
  461.     public function getDatePayment()
  462.     {
  463.         return $this->datePayment;
  464.     }
  465.     /**
  466.      * Set estatusPayment
  467.      *
  468.      * @param string $estatusPayment
  469.      *
  470.      * @return MobileAppPackageSold
  471.      */
  472.     public function setEstatusPayment($estatusPayment)
  473.     {
  474.         $this->estatusPayment $estatusPayment;
  475.     
  476.         return $this;
  477.     }
  478.     /**
  479.      * Get estatusPayment
  480.      *
  481.      * @return string
  482.      */
  483.     public function getEstatusPayment()
  484.     {
  485.         return $this->estatusPayment;
  486.     }
  487.     /**
  488.      * @ORM\PrePersist
  489.      */
  490.     public function setCreatedAtValue()
  491.     {
  492.         $this->createdAt = new \Datetime();
  493.     }
  494.     /**
  495.      * @return Collection<int, SoldPackagesSales>
  496.      */
  497.     public function getSoldPackagesSales(): Collection
  498.     {
  499.         return $this->soldPackagesSales;
  500.     }
  501.     public function addSoldPackagesSale(SoldPackagesSales $soldPackagesSale): self
  502.     {
  503.         if (!$this->soldPackagesSales->contains($soldPackagesSale)) {
  504.             $this->soldPackagesSales[] = $soldPackagesSale;
  505.             $soldPackagesSale->setMobileAppPackageSold($this);
  506.         }
  507.         return $this;
  508.     }
  509.     public function removeSoldPackagesSale(SoldPackagesSales $soldPackagesSale): self
  510.     {
  511.         if ($this->soldPackagesSales->removeElement($soldPackagesSale)) {
  512.             // set the owning side to null (unless already changed)
  513.             if ($soldPackagesSale->getMobileAppPackageSold() === $this) {
  514.                 $soldPackagesSale->setMobileAppPackageSold(null);
  515.             }
  516.         }
  517.         return $this;
  518.     }
  519.     public function getMethod(): ?string
  520.     {
  521.         return $this->method;
  522.     }
  523.     public function setMethod(string $method): self
  524.     {
  525.         $this->method $method;
  526.         return $this;
  527.     }
  528.     /**
  529.      * @return Collection<int, AppMobileGuest>
  530.      */
  531.     public function getAppMobileGuests(): Collection
  532.     {
  533.         return $this->appMobileGuests;
  534.     }
  535.     public function addAppMobileGuest(AppMobileGuest $appMobileGuest): self
  536.     {
  537.         if (!$this->appMobileGuests->contains($appMobileGuest)) {
  538.             $this->appMobileGuests[] = $appMobileGuest;
  539.             $appMobileGuest->setPackageSold($this);
  540.         }
  541.         return $this;
  542.     }
  543.     public function removeAppMobileGuest(AppMobileGuest $appMobileGuest): self
  544.     {
  545.         if ($this->appMobileGuests->removeElement($appMobileGuest)) {
  546.             // set the owning side to null (unless already changed)
  547.             if ($appMobileGuest->getPackageSold() === $this) {
  548.                 $appMobileGuest->setPackageSold(null);
  549.             }
  550.         }
  551.         return $this;
  552.     }
  553. }