<?php
namespace 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;
use Symfony\Component\Validator\Constraints as Assert;
//use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=OrderRepository::class)
* @ORM\Table(name="order_order")
*/
class Order
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string $ws_id
*
* @ORM\Column(type="string", nullable=true)
*/
protected $ws_id;
/**
* @var string $account_id
*
* @ORM\Column(type="string", nullable=true)
*/
protected $account_id;
/**
* @var string $tasks
*
* @ORM\Column(type="string", nullable=true)
*/
protected $tasks;
/**
* @var \App\Entity\SonataUserUser $user
*
* @ORM\ManyToOne(targetEntity="App\Entity\SonataUserUser", inversedBy="orders")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @ORM\OneToMany(targetEntity = "App\Entity\OrderProduct", mappedBy="order")
*/
protected $products;
/**
* @var string $status
*
* @ORM\Column(type="string", nullable=true)
*/
protected $status;
/**
* @var string $status_msg
*
* @ORM\Column(type="string", nullable=true)
*/
protected $status_msg;
/**
* @var string $file_name
*
* @ORM\Column(type="string", nullable=true)
*/
protected $file_name;
/**
* @var string $contact_name
*
* @ORM\Column(type="string", nullable=true)
*/
protected $contact_name;
/**
* @var string $contact_phone
*
* @ORM\Column(type="string", nullable=true)
*/
protected $contact_phone;
/**
* @var string $contact_city
*
* @ORM\Column(type="string", nullable=true)
*/
protected $contact_city;
/**
* @var string $contact_address
*
* @ORM\Column(type="string", nullable=true)
*/
protected $contact_address;
/**
* @var string $create_at
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime", nullable=true)
*/
protected $create_at;
/**
* @var string $update_at
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column(type="datetime", nullable=true)
*/
protected $update_at;
public function __construct()
{
$this->products = new ArrayCollection();
}
public function __toString(): string
{
// return $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getCreateAt(): ?\DateTimeInterface
{
return $this->create_at;
}
public function setCreateAt(?\DateTimeInterface $create_at): static
{
$this->create_at = $create_at;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->update_at;
}
public function setUpdateAt(?\DateTimeInterface $update_at): static
{
$this->update_at = $update_at;
return $this;
}
public function getUser(): ?SonataUserUser
{
return $this->user;
}
public function setUser(?SonataUserUser $user): static
{
$this->user = $user;
return $this;
}
/**
* @return Collection<int, OrderProduct>
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(OrderProduct $product): static
{
if (!$this->products->contains($product)) {
$this->products->add($product);
$product->setOrder($this);
}
return $this;
}
public function removeProduct(OrderProduct $product): static
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getOrder() === $this) {
$product->setOrder(null);
}
}
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): static
{
$this->status = $status;
return $this;
}
public function getStatusMsg(): ?string
{
return $this->status_msg;
}
public function setStatusMsg(?string $status_msg): static
{
$this->status_msg = $status_msg;
return $this;
}
public function getWsId(): ?string
{
return $this->ws_id;
}
public function setWsId(?string $ws_id): static
{
$this->ws_id = $ws_id;
return $this;
}
public function getAccountId(): ?string
{
return $this->account_id;
}
public function setAccountId(?string $account_id): static
{
$this->account_id = $account_id;
return $this;
}
public function getTasks(): ?string
{
return $this->tasks;
}
public function setTasks(?string $tasks): static
{
$this->tasks = $tasks;
return $this;
}
public function getContactName(): ?string
{
return $this->contact_name;
}
public function setContactName(?string $contact_name): static
{
$this->contact_name = $contact_name;
return $this;
}
public function getContactPhone(): ?string
{
return $this->contact_phone;
}
public function setContactPhone(?string $contact_phone): static
{
$this->contact_phone = $contact_phone;
return $this;
}
public function getContactCity(): ?string
{
return $this->contact_city;
}
public function setContactCity(?string $contact_city): static
{
$this->contact_city = $contact_city;
return $this;
}
public function getContactAddress(): ?string
{
return $this->contact_address;
}
public function setContactAddress(?string $contact_address): static
{
$this->contact_address = $contact_address;
return $this;
}
public function getFileName(): ?string
{
return $this->file_name;
}
public function setFileName(?string $file_name): static
{
$this->file_name = $file_name;
return $this;
}
}