src/Entity/Order.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use ApiPlatform\Core\Annotation\ApiFilter;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  6. use App\Repository\OrderRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10.  * @ORM\Entity(repositoryClass=OrderRepository::class)
  11.  * @ORM\HasLifecycleCallbacks()
  12.  * @ApiResource(
  13.  *     normalizationContext={"groups"={"order:read", "base:read", "assign:read"}},
  14.  *     denormalizationContext={"groups"={"order:write", "base:write", "assign:write"}},
  15.  * )
  16.  * @ORM\EntityListeners({"App\EventListener\AbstractListener"})
  17.  * @ORM\Table(name="`order`")
  18.  */
  19. class Order
  20. {
  21.     /**
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue
  24.      * @ORM\Column(type="integer")
  25.      * @Groups({"order:read"})
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      * @Groups({"order:read", "order:write"})
  31.      */
  32.     private $name;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      */
  36.     private $orderNo;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, options={"default": "Pending"})
  39.      * @Groups({"order:read", "order:write"})
  40.      */
  41.     private $status 'Pending';
  42.     /**
  43.      * @ORM\Column(type="string", length=255, options={"default": "Waiting"})
  44.      */
  45.     private $paymentStatus 'Waiting';
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=User::class)
  48.      * @ORM\JoinColumn(nullable=false)
  49.      */
  50.     private $assignedUser;
  51.     /**
  52.      * @ORM\Column(type="datetime")
  53.      * @Groups({"order:read", "order:write"})
  54.      */
  55.     private $createdAt;
  56.     /**
  57.      * @ORM\Column(type="datetime")
  58.      */
  59.     private $editedAt;
  60.     /**
  61.      * @ORM\Column(type="text", nullable=true)
  62.      */
  63.     private $description;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, options={"default": "cart"})
  66.      * @Groups({"order:read", "order:write"})
  67.      */
  68.     private $type 'cart';
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      * @Groups({"order:read", "order:write"})
  72.      */
  73.     private $paymentMethod;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $paymentMethodId;
  78.     /**
  79.      * @ORM\Column(type="array", nullable=true)
  80.      */
  81.     private $paymentInfo = [];
  82.     /**
  83.      * @ORM\Column(type="string", length=255, nullable=true)
  84.      */
  85.     private $billingAddress1;
  86.     /**
  87.      * @ORM\Column(type="string", length=255, nullable=true)
  88.      */
  89.     private $billingAddress2;
  90.     /**
  91.      * @ORM\Column(type="string", length=255, nullable=true)
  92.      */
  93.     private $billingCity;
  94.     /**
  95.      * @ORM\Column(type="string", length=255, nullable=true)
  96.      */
  97.     private $billingState;
  98.     /**
  99.      * @ORM\Column(type="string", length=255, nullable=true)
  100.      */
  101.     private $billingZipCode;
  102.     /**
  103.      * @ORM\Column(type="string", length=255, nullable=true)
  104.      */
  105.     private $billingCountry;
  106.     /**
  107.      * @ORM\Column(type="string", length=255, nullable=true)
  108.      */
  109.     private $shippingAddress1;
  110.     /**
  111.      * @ORM\Column(type="string", length=255, nullable=true)
  112.      */
  113.     private $shippingAddress2;
  114.     /**
  115.      * @ORM\Column(type="string", length=255, nullable=true)
  116.      */
  117.     private $shippingCity;
  118.     /**
  119.      * @ORM\Column(type="string", length=255, nullable=true)
  120.      */
  121.     private $shippingState;
  122.     /**
  123.      * @ORM\Column(type="string", length=255, nullable=true)
  124.      */
  125.     private $shippingZipCode;
  126.     /**
  127.      * @ORM\Column(type="string", length=255, nullable=true)
  128.      */
  129.     private $shippingCountry;
  130.     /**
  131.      * @ORM\Column(type="decimal", precision=17, scale=6, options={"default": 0})
  132.      */
  133.     private $subtotal 0;
  134.     /**
  135.      * @ORM\Column(type="decimal", precision=17, scale=6, options={"default": 0})
  136.      * @Groups({"order:read", "order:write"})
  137.      */
  138.     private $total 0;
  139.     /**
  140.      * @ORM\Column(type="decimal", precision=17, scale=6, options={"default": 0})
  141.      */
  142.     private $discount 0;
  143.     /**
  144.      * @ORM\Column(type="string", length=100, nullable=true)
  145.      */
  146.     private $billingFirstName;
  147.     /**
  148.      * @ORM\Column(type="string", length=100, nullable=true)
  149.      */
  150.     private $billingLastName;
  151.     /**
  152.      * @ORM\Column(type="string", length=255, nullable=true)
  153.      * @Groups({"order:read", "order:write"})
  154.      */
  155.     private $billingCompany;
  156.     /**
  157.      * @ORM\Column(type="string", length=100, nullable=true)
  158.      */
  159.     private $billingPhone;
  160.     /**
  161.      * @ORM\Column(type="string", length=100, nullable=true)
  162.      */
  163.     private $billingEmail;
  164.     /**
  165.      * @ORM\Column(type="string", length=100, nullable=true)
  166.      */
  167.     private $coupon;
  168.     /**
  169.      * @ORM\ManyToOne(targetEntity=Member::class, inversedBy="orders")
  170.      * @Groups({"order:read", "order:write"})
  171.      */
  172.     private $assignedMember;
  173.     /**
  174.      * @ORM\Column(type="datetime", nullable=true)
  175.      */
  176.     private $abandonTime;
  177.     /**
  178.      * @ORM\Column(type="string", length=255, options={"default": "eXchange"})
  179.      * @Groups({"order:read", "order:write"})
  180.      */
  181.     private $source 'eXchange';
  182.     /**
  183.      * @ORM\Column(type="boolean", nullable=true, options={"default": false})
  184.      * @Groups({"order:read", "order:write"})
  185.      */
  186.     private $deleted false;
  187.     /**
  188.      * @ORM\Column(type="string", length=100, nullable=true)
  189.      * @Groups({"order:read", "order:write"})
  190.      */
  191.     private $deletedBy;
  192.     /**
  193.      * @ORM\Column(type="datetime", nullable=true)
  194.      * @Groups({"order:read", "order:write"})
  195.      */
  196.     private $deletedTime;
  197.     public function getId(): ?int
  198.     {
  199.         return $this->id;
  200.     }
  201.     public function getName(): ?string
  202.     {
  203.         return $this->name;
  204.     }
  205.     public function setName(string $name): self
  206.     {
  207.         $this->name $name;
  208.         return $this;
  209.     }
  210.     public function getOrderNo(): ?string
  211.     {
  212.         return $this->orderNo;
  213.     }
  214.     public function setOrderNo(string $orderNo): self
  215.     {
  216.         $this->orderNo $orderNo;
  217.         return $this;
  218.     }
  219.     public function getStatus(): ?string
  220.     {
  221.         return $this->status;
  222.     }
  223.     public function setStatus(string $status): self
  224.     {
  225.         $this->status $status;
  226.         return $this;
  227.     }
  228.     public function getPaymentStatus(): ?string
  229.     {
  230.         return $this->paymentStatus;
  231.     }
  232.     public function setPaymentStatus(string $paymentStatus): self
  233.     {
  234.         $this->paymentStatus $paymentStatus;
  235.         return $this;
  236.     }
  237.     public function getAssignedUser(): ?User
  238.     {
  239.         return $this->assignedUser;
  240.     }
  241.     public function setAssignedUser(?User $assignedUser): self
  242.     {
  243.         $this->assignedUser $assignedUser;
  244.         return $this;
  245.     }
  246.     public function getCreatedAt(): ?\DateTimeInterface
  247.     {
  248.         return $this->createdAt;
  249.     }
  250.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  251.     {
  252.         $this->createdAt $createdAt;
  253.         return $this;
  254.     }
  255.     public function getEditedAt(): ?\DateTimeInterface
  256.     {
  257.         return $this->editedAt;
  258.     }
  259.     public function setEditedAt(\DateTimeInterface $editedAt): self
  260.     {
  261.         $this->editedAt $editedAt;
  262.         return $this;
  263.     }
  264.     public function getDescription(): ?string
  265.     {
  266.         return $this->description;
  267.     }
  268.     public function setDescription(?string $description): self
  269.     {
  270.         $this->description $description;
  271.         return $this;
  272.     }
  273.     public function getType(): ?string
  274.     {
  275.         return $this->type;
  276.     }
  277.     public function setType(string $type): self
  278.     {
  279.         $this->type $type;
  280.         return $this;
  281.     }
  282.     public function getPaymentMethod(): ?string
  283.     {
  284.         return $this->paymentMethod;
  285.     }
  286.     public function setPaymentMethod(?string $paymentMethod): self
  287.     {
  288.         $this->paymentMethod $paymentMethod;
  289.         return $this;
  290.     }
  291.     public function getPaymentMethodId(): ?string
  292.     {
  293.         return $this->paymentMethodId;
  294.     }
  295.     public function setPaymentMethodId(?string $paymentMethodId): self
  296.     {
  297.         $this->paymentMethodId $paymentMethodId;
  298.         return $this;
  299.     }
  300.     public function getPaymentInfo(): ?array
  301.     {
  302.         return $this->paymentInfo;
  303.     }
  304.     public function setPaymentInfo(?array $paymentInfo): self
  305.     {
  306.         $this->paymentInfo $paymentInfo;
  307.         return $this;
  308.     }
  309.     public function getBillingAddress1(): ?string
  310.     {
  311.         return $this->billingAddress1;
  312.     }
  313.     public function setBillingAddress1(?string $billingAddress1): self
  314.     {
  315.         $this->billingAddress1 $billingAddress1;
  316.         return $this;
  317.     }
  318.     public function getBillingAddress2(): ?string
  319.     {
  320.         return $this->billingAddress2;
  321.     }
  322.     public function setBillingAddress2(?string $billingAddress2): self
  323.     {
  324.         $this->billingAddress2 $billingAddress2;
  325.         return $this;
  326.     }
  327.     public function getBillingCity(): ?string
  328.     {
  329.         return $this->billingCity;
  330.     }
  331.     public function setBillingCity(?string $billingCity): self
  332.     {
  333.         $this->billingCity $billingCity;
  334.         return $this;
  335.     }
  336.     public function getBillingState(): ?string
  337.     {
  338.         return $this->billingState;
  339.     }
  340.     public function setBillingState(?string $billingState): self
  341.     {
  342.         $this->billingState $billingState;
  343.         return $this;
  344.     }
  345.     public function getBillingZipCode(): ?string
  346.     {
  347.         return $this->billingZipCode;
  348.     }
  349.     public function setBillingZipCode(?string $billingZipCode): self
  350.     {
  351.         $this->billingZipCode $billingZipCode;
  352.         return $this;
  353.     }
  354.     public function getBillingCountry(): ?string
  355.     {
  356.         return $this->billingCountry;
  357.     }
  358.     public function setBillingCountry(?string $billingCountry): self
  359.     {
  360.         $this->billingCountry $billingCountry;
  361.         return $this;
  362.     }
  363.     public function getShippingAddress1(): ?string
  364.     {
  365.         return $this->shippingAddress1;
  366.     }
  367.     public function setShippingAddress1(?string $shippingAddress1): self
  368.     {
  369.         $this->shippingAddress1 $shippingAddress1;
  370.         return $this;
  371.     }
  372.     public function getShippingAddress2(): ?string
  373.     {
  374.         return $this->shippingAddress2;
  375.     }
  376.     public function setShippingAddress2(?string $shippingAddress2): self
  377.     {
  378.         $this->shippingAddress2 $shippingAddress2;
  379.         return $this;
  380.     }
  381.     public function getShippingCity(): ?string
  382.     {
  383.         return $this->shippingCity;
  384.     }
  385.     public function setShippingCity(?string $shippingCity): self
  386.     {
  387.         $this->shippingCity $shippingCity;
  388.         return $this;
  389.     }
  390.     public function getShippingState(): ?string
  391.     {
  392.         return $this->shippingState;
  393.     }
  394.     public function setShippingState(?string $shippingState): self
  395.     {
  396.         $this->shippingState $shippingState;
  397.         return $this;
  398.     }
  399.     public function getShippingZipCode(): ?string
  400.     {
  401.         return $this->shippingZipCode;
  402.     }
  403.     public function setShippingZipCode(?string $shippingZipCode): self
  404.     {
  405.         $this->shippingZipCode $shippingZipCode;
  406.         return $this;
  407.     }
  408.     public function getShippingCountry(): ?string
  409.     {
  410.         return $this->shippingCountry;
  411.     }
  412.     public function setShippingCountry(?string $shippingCountry): self
  413.     {
  414.         $this->shippingCountry $shippingCountry;
  415.         return $this;
  416.     }
  417.     public function getSubtotal(): ?string
  418.     {
  419.         return $this->subtotal;
  420.     }
  421.     public function setSubtotal(string $subtotal): self
  422.     {
  423.         $this->subtotal $subtotal;
  424.         return $this;
  425.     }
  426.     public function getTotal(): ?string
  427.     {
  428.         return $this->total;
  429.     }
  430.     public function setTotal(string $total): self
  431.     {
  432.         $this->total $total;
  433.         return $this;
  434.     }
  435.     public function getDiscount(): ?string
  436.     {
  437.         return $this->discount;
  438.     }
  439.     public function setDiscount(string $discount): self
  440.     {
  441.         $this->discount $discount;
  442.         return $this;
  443.     }
  444.     public function getBillingFirstName(): ?string
  445.     {
  446.         return $this->billingFirstName;
  447.     }
  448.     public function setBillingFirstName(?string $billingFirstName): self
  449.     {
  450.         $this->billingFirstName $billingFirstName;
  451.         return $this;
  452.     }
  453.     public function getBillingLastName(): ?string
  454.     {
  455.         return $this->billingLastName;
  456.     }
  457.     public function setBillingLastName(?string $billingLastName): self
  458.     {
  459.         $this->billingLastName $billingLastName;
  460.         return $this;
  461.     }
  462.     public function getBillingCompany(): ?string
  463.     {
  464.         return $this->billingCompany;
  465.     }
  466.     public function setBillingCompany(?string $billingCompany): self
  467.     {
  468.         $this->billingCompany $billingCompany;
  469.         return $this;
  470.     }
  471.     public function getBillingPhone(): ?string
  472.     {
  473.         return $this->billingPhone;
  474.     }
  475.     public function setBillingPhone(?string $billingPhone): self
  476.     {
  477.         $this->billingPhone $billingPhone;
  478.         return $this;
  479.     }
  480.     public function getBillingEmail(): ?string
  481.     {
  482.         return $this->billingEmail;
  483.     }
  484.     public function setBillingEmail(?string $billingEmail): self
  485.     {
  486.         $this->billingEmail $billingEmail;
  487.         return $this;
  488.     }
  489.     public function getCoupon(): ?string
  490.     {
  491.         return $this->coupon;
  492.     }
  493.     public function setCoupon(?string $coupon): self
  494.     {
  495.         $this->coupon $coupon;
  496.         return $this;
  497.     }
  498.     public function getAssignedMember(): ?Member
  499.     {
  500.         return $this->assignedMember;
  501.     }
  502.     public function setAssignedMember(?Member $assignedMember): self
  503.     {
  504.         $this->assignedMember $assignedMember;
  505.         return $this;
  506.     }
  507.     public function getAbandonTime(): ?\DateTimeInterface
  508.     {
  509.         return $this->abandonTime;
  510.     }
  511.     public function setAbandonTime(?\DateTimeInterface $abandonTime): self
  512.     {
  513.         $this->abandonTime $abandonTime;
  514.         return $this;
  515.     }
  516.     public function getSource(): ?string
  517.     {
  518.         return $this->source;
  519.     }
  520.     public function setSource(?string $source): self
  521.     {
  522.         $this->source $source;
  523.         return $this;
  524.     }
  525.     public function isDeleted(): ?bool
  526.     {
  527.         return $this->deleted;
  528.     }
  529.     public function setDeleted(?bool $deleted): self
  530.     {
  531.         $this->deleted $deleted;
  532.         return $this;
  533.     }
  534.     public function getDeletedBy(): ?string
  535.     {
  536.         return $this->deletedBy;
  537.     }
  538.     public function setDeletedBy(?string $deletedBy): self
  539.     {
  540.         $this->deletedBy $deletedBy;
  541.         return $this;
  542.     }
  543.     public function getDeletedTime(): ?\DateTimeInterface
  544.     {
  545.         return $this->deletedTime;
  546.     }
  547.     public function setDeletedTime(?\DateTimeInterface $deletedTime): self
  548.     {
  549.         $this->deletedTime $deletedTime;
  550.         return $this;
  551.     }
  552. }