src/Entity/Order.php line 13
<?phpnamespace App\Entity;use App\Repository\OrderRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OrderRepository::class)]#[ORM\Table(name: '`order`')]class Order{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?User $order_user = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $order_date = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]private ?string $order_total_price = null;#[ORM\OneToMany(mappedBy: 'order_item_order', targetEntity: OrderItem::class, cascade: ['persist', 'remove'], orphanRemoval: true )]private Collection $order_items;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?Status $order_status = null;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?Address $order_address = null;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?BillingAddress $order_billing_address = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]private ?string $order_shipping_cost = null;#[ORM\Column(length: 25, nullable: true)]private ?string $order_tracking_number = null;public function __construct(){$this->order_items = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getOrderUser(): ?User{return $this->order_user;}public function setOrderUser(?User $user): self{$this->order_user = $user;return $this;}public function getOrderDate(): ?\DateTimeInterface{return $this->order_date;}public function setOrderDate(\DateTimeInterface $order_date): self{$this->order_date = $order_date;return $this;}public function getOrderTotalPrice(): ?string{return $this->order_total_price;}public function setOrderTotalPrice(string $order_total_price): self{$this->order_total_price = $order_total_price;return $this;}/*** @return Collection<int, OrderItem>*/public function getOrderItems(): Collection{return $this->order_items;}public function addOrderItem(OrderItem $orderItem): self{if (!$this->order_items->contains($orderItem)) {$this->order_items->add($orderItem);$orderItem->setOrderItemOrder($this);}return $this;}public function removeOrderItem(OrderItem $orderItem): self{if ($this->order_items->removeElement($orderItem)) {// set the owning side to null (unless already changed)if ($orderItem->getOrderItemOrder() === $this) {$orderItem->setOrderItemOrder(null);}}return $this;}public function getOrderStatus(): ?Status{return $this->order_status;}public function setOrderStatus(?Status $order_status): self{$this->order_status = $order_status;return $this;}public function getOrderAddress(): ?Address{return $this->order_address;}public function setOrderAddress(?Address $order_address): self{$this->order_address = $order_address;return $this;}public function getOrderBillingAddress(): ?BillingAddress{return $this->order_billing_address;}public function setOrderBillingAddress(?BillingAddress $order_billing_address): self{$this->order_billing_address = $order_billing_address;return $this;}public function getOrderShippingCost(): ?string{return $this->order_shipping_cost;}public function setOrderShippingCost(string $order_shipping_cost): self{$this->order_shipping_cost = $order_shipping_cost;return $this;}public function __toString(): string{return $this->id . ' ' . $this->order_user;}public function getOrderTrackingNumber(): ?string{return $this->order_tracking_number;}public function setOrderTrackingNumber(?string $order_tracking_number): self{$this->order_tracking_number = $order_tracking_number;return $this;}}