src/Admin/Modules/Store/Entity/StoreOrder.php line 17

  1. <?php
  2. namespace App\Admin\Modules\Store\Entity;
  3. use App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use App\Modules\User\Entity\User;
  10. /**
  11.  * @ORM\Table(name="store_order", indexes={@ORM\Index(columns={"number"}), @ORM\Index(columns={"first_name"}), @ORM\Index(columns={"last_name"}), @ORM\Index(columns={"email"}), @ORM\Index(columns={"deadline_date"}), @ORM\Index(columns={"added_at"})})
  12.  * @ORM\Entity(repositoryClass="App\Admin\Modules\Store\Repository\StoreOrderRepository")
  13.  */
  14. class StoreOrder
  15. {
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(type="bigint", options={"unsigned"=true}))
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     protected $id;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(name="number", type="string", length=50, nullable=false)
  28.      */
  29.     private $number;    
  30.     
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="first_name", type="string", length=255, nullable=true)
  35.      */
  36.     private $firstName;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="last_name", type="string", length=255, nullable=true)
  41.      */
  42.     private $lastName;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(name="street", type="string", length=255, nullable=true)
  47.      */
  48.     private $street;
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(name="postal_code", type="string", length=25, nullable=true)
  53.      */
  54.     private $postalCode;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="city", type="string", length=255, nullable=true)
  59.      */
  60.     private $city;
  61.     /**
  62.      * @var string
  63.      *
  64.      * @ORM\Column(name="email", type="string", length=255, nullable=true)
  65.      */
  66.     private $email;
  67.     /**
  68.      * @var string
  69.      *
  70.      * @ORM\Column(name="phone", type="string", length=25, nullable=true)
  71.      */
  72.     private $phone;
  73.     
  74.     /**
  75.      * @var string
  76.      *
  77.      * @ORM\Column(name="shipping_first_name", type="string", length=255, nullable=true)
  78.      */
  79.     private $shippingFirstName;
  80.     /**
  81.      * @var string
  82.      *
  83.      * @ORM\Column(name="shipping_last_name", type="string", length=255, nullable=true)
  84.      */
  85.     private $shippingLastName;
  86.     /**
  87.      * @var string
  88.      *
  89.      * @ORM\Column(name="shipping_street", type="string", length=255, nullable=true)
  90.      */
  91.     private $shippingStreet;    
  92.     /**
  93.      * @var string
  94.      *
  95.      * @ORM\Column(name="shipping_postal_code", type="string", length=25, nullable=true)
  96.      */
  97.     private $shippingPostalCode;
  98.     /**
  99.      * @var string
  100.      *
  101.      * @ORM\Column(name="shipping_city", type="string", length=255, nullable=true)
  102.      */
  103.     private $shippingCity;
  104.     /**
  105.      * @var string
  106.      *
  107.      * @ORM\Column(name="shipping_email", type="string", length=255, nullable=true)
  108.      */
  109.     private $shippingEmail;
  110.     /**
  111.      * @var string
  112.      *
  113.      * @ORM\Column(name="shipping_phone", type="string", length=25, nullable=true)
  114.      */
  115.     private $shippingPhone;
  116.     /**
  117.      * @var \DateTime
  118.      *
  119.      * @ORM\Column(name="deadline_date", type="date", nullable=false)
  120.      */
  121.     private $deadlineDate;
  122.     
  123.     /**
  124.      * @var string
  125.      *
  126.      * @ORM\Column(name="delivery_name", type="string", length=255, nullable=false)
  127.      */
  128.     private $deliveryName;    
  129.     /**
  130.      * @var string
  131.      *
  132.      * @ORM\Column(name="delivery_price", type="decimal", precision=14, scale=2, nullable=false)
  133.      */
  134.     private $deliveryPrice;
  135.     /**
  136.      * @var \App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher
  137.      *
  138.      * @ORM\ManyToOne(targetEntity="App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher", inversedBy="storeOrder")
  139.      * @ORM\JoinColumns({
  140.      *   @ORM\JoinColumn(name="id_voucher_package_voucher", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  141.      * })
  142.      */
  143.     private $voucher;
  144.     
  145.     /**
  146.      * @var string
  147.      *
  148.      * @ORM\Column(name="voucher_number", type="string", length=255, nullable=true)
  149.      */
  150.     private $voucherNumber;
  151.     /**
  152.      * @var string
  153.      *
  154.      * @ORM\Column(name="voucher_type", type="string", length=255, nullable=true)
  155.      */
  156.     private $voucherType;
  157.     
  158.     /**
  159.      * @var int
  160.      *
  161.      * @ORM\Column(name="voucher_value", type="integer", nullable=true)
  162.      */
  163.     private $voucherValue;    
  164.     /**
  165.      * @var \App\Modules\User\Entity\User
  166.      *
  167.      * @ORM\ManyToOne(targetEntity="App\Modules\User\Entity\User")
  168.      * @ORM\JoinColumns({
  169.      *   @ORM\JoinColumn(name="id_admin_user", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  170.      * })
  171.      */
  172.     private $adminUser;
  173.     
  174.     /**
  175.      * @var \DateTime
  176.      *
  177.      * @ORM\Column(name="added_at", type="datetime", nullable=false)
  178.      */
  179.     private $addedAt;
  180.     
  181.     /**
  182.      * @var \App\Admin\Modules\Store\Entity\StoreOrderProduct
  183.      *
  184.      * @ORM\OneToMany(targetEntity="App\Admin\Modules\Store\Entity\StoreOrderProduct", mappedBy="order", cascade={"persist"}, orphanRemoval=true)
  185.      * @ORM\OrderBy({"id"="ASC"})
  186.      */
  187.     private $products;
  188.     public function __construct()
  189.     {
  190.         $this->products = new ArrayCollection();
  191.     }
  192.     public function getId(): ?string
  193.     {
  194.         return $this->id;
  195.     }
  196.     public function getNumber(): ?string
  197.     {
  198.         return $this->number;
  199.     }
  200.     public function setNumber(string $number): self
  201.     {
  202.         $this->number $number;
  203.         return $this;
  204.     }
  205.     public function getAddedAt(): ?\DateTimeInterface
  206.     {
  207.         return $this->addedAt;
  208.     }
  209.     public function setAddedAt(\DateTimeInterface $addedAt): self
  210.     {
  211.         $this->addedAt $addedAt;
  212.         return $this;
  213.     }
  214.     public function getAdminUser(): ?User
  215.     {
  216.         return $this->adminUser;
  217.     }
  218.     public function setAdminUser(?User $adminUser): self
  219.     {
  220.         $this->adminUser $adminUser;
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return Collection<int, StoreOrderProduct>
  225.      */
  226.     public function getProducts(): Collection
  227.     {
  228.         return $this->products;
  229.     }
  230.     public function addProduct(StoreOrderProduct $product): self
  231.     {
  232.         if (!$this->products->contains($product)) {
  233.             $this->products->add($product);
  234.             $product->setOrder($this);
  235.         }
  236.         return $this;
  237.     }
  238.     public function removeProduct(StoreOrderProduct $product): self
  239.     {
  240.         if ($this->products->removeElement($product)) {
  241.             // set the owning side to null (unless already changed)
  242.             if ($product->getOrder() === $this) {
  243.                 $product->setOrder(null);
  244.             }
  245.         }
  246.         return $this;
  247.     }
  248.     public function getFirstName(): ?string
  249.     {
  250.         return $this->firstName;
  251.     }
  252.     public function setFirstName(?string $firstName): self
  253.     {
  254.         $this->firstName $firstName;
  255.         return $this;
  256.     }
  257.     public function getLastName(): ?string
  258.     {
  259.         return $this->lastName;
  260.     }
  261.     public function setLastName(?string $lastName): self
  262.     {
  263.         $this->lastName $lastName;
  264.         return $this;
  265.     }
  266.     public function getStreet(): ?string
  267.     {
  268.         return $this->street;
  269.     }
  270.     public function setStreet(?string $street): self
  271.     {
  272.         $this->street $street;
  273.         return $this;
  274.     }
  275.     public function getPostalCode(): ?string
  276.     {
  277.         return $this->postalCode;
  278.     }
  279.     public function setPostalCode(?string $postalCode): self
  280.     {
  281.         $this->postalCode $postalCode;
  282.         return $this;
  283.     }
  284.     public function getCity(): ?string
  285.     {
  286.         return $this->city;
  287.     }
  288.     public function setCity(?string $city): self
  289.     {
  290.         $this->city $city;
  291.         return $this;
  292.     }
  293.     public function getEmail(): ?string
  294.     {
  295.         return $this->email;
  296.     }
  297.     public function setEmail(?string $email): self
  298.     {
  299.         $this->email $email;
  300.         return $this;
  301.     }
  302.     public function getPhone(): ?string
  303.     {
  304.         return $this->phone;
  305.     }
  306.     public function setPhone(?string $phone): self
  307.     {
  308.         $this->phone $phone;
  309.         return $this;
  310.     }
  311.     public function getDeadlineDate(): ?\DateTimeInterface
  312.     {
  313.         return $this->deadlineDate;
  314.     }
  315.     public function setDeadlineDate(\DateTimeInterface $deadlineDate): self
  316.     {
  317.         $this->deadlineDate $deadlineDate;
  318.         return $this;
  319.     }
  320.     public function getDeliveryName(): ?string
  321.     {
  322.         return $this->deliveryName;
  323.     }
  324.     public function setDeliveryName(string $deliveryName): self
  325.     {
  326.         $this->deliveryName $deliveryName;
  327.         return $this;
  328.     }
  329.     public function getDeliveryPrice(): ?string
  330.     {
  331.         return $this->deliveryPrice;
  332.     }
  333.     public function setDeliveryPrice(string $deliveryPrice): self
  334.     {
  335.         $this->deliveryPrice $deliveryPrice;
  336.         return $this;
  337.     }
  338.     public function getShippingStreet(): ?string
  339.     {
  340.         return $this->shippingStreet;
  341.     }
  342.     public function setShippingStreet(?string $shippingStreet): self
  343.     {
  344.         $this->shippingStreet $shippingStreet;
  345.         return $this;
  346.     }
  347.     public function getShippingPostalCode(): ?string
  348.     {
  349.         return $this->shippingPostalCode;
  350.     }
  351.     public function setShippingPostalCode(?string $shippingPostalCode): self
  352.     {
  353.         $this->shippingPostalCode $shippingPostalCode;
  354.         return $this;
  355.     }
  356.     public function getShippingCity(): ?string
  357.     {
  358.         return $this->shippingCity;
  359.     }
  360.     public function setShippingCity(?string $shippingCity): self
  361.     {
  362.         $this->shippingCity $shippingCity;
  363.         return $this;
  364.     }
  365.     public function getShippingEmail(): ?string
  366.     {
  367.         return $this->shippingEmail;
  368.     }
  369.     public function setShippingEmail(?string $shippingEmail): self
  370.     {
  371.         $this->shippingEmail $shippingEmail;
  372.         return $this;
  373.     }
  374.     public function getShippingPhone(): ?string
  375.     {
  376.         return $this->shippingPhone;
  377.     }
  378.     public function setShippingPhone(?string $shippingPhone): self
  379.     {
  380.         $this->shippingPhone $shippingPhone;
  381.         return $this;
  382.     }
  383.     public function getShippingFirstName(): ?string
  384.     {
  385.         return $this->shippingFirstName;
  386.     }
  387.     public function setShippingFirstName(?string $shippingFirstName): self
  388.     {
  389.         $this->shippingFirstName $shippingFirstName;
  390.         return $this;
  391.     }
  392.     public function getShippingLastName(): ?string
  393.     {
  394.         return $this->shippingLastName;
  395.     }
  396.     public function setShippingLastName(?string $shippingLastName): self
  397.     {
  398.         $this->shippingLastName $shippingLastName;
  399.         return $this;
  400.     }
  401.     public function getVoucherNumber(): ?string
  402.     {
  403.         return $this->voucherNumber;
  404.     }
  405.     public function setVoucherNumber(?string $voucherNumber): self
  406.     {
  407.         $this->voucherNumber $voucherNumber;
  408.         return $this;
  409.     }
  410.     public function getVoucherType(): ?string
  411.     {
  412.         return $this->voucherType;
  413.     }
  414.     public function setVoucherType(?string $voucherType): self
  415.     {
  416.         $this->voucherType $voucherType;
  417.         return $this;
  418.     }
  419.     public function getVoucherValue(): ?int
  420.     {
  421.         return $this->voucherValue;
  422.     }
  423.     public function setVoucherValue(?int $voucherValue): self
  424.     {
  425.         $this->voucherValue $voucherValue;
  426.         return $this;
  427.     }
  428.     public function getVoucher(): ?VoucherPackageVoucher
  429.     {
  430.         return $this->voucher;
  431.     }
  432.     public function setVoucher(?VoucherPackageVoucher $voucher): self
  433.     {
  434.         $this->voucher $voucher;
  435.         return $this;
  436.     }    
  437. }