src/Entity/Order.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderRepository;
  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 Symfony\Component\Validator\Constraints as Assert;
  9. //use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. /**
  12.  * @ORM\Entity(repositoryClass=OrderRepository::class)
  13.  * @ORM\Table(name="order_order")
  14.  */
  15. class Order
  16. {
  17.     /**
  18.         * @ORM\Id
  19.         * @ORM\Column(type="integer")
  20.         * @ORM\GeneratedValue(strategy="AUTO")
  21.         */
  22.         protected $id;
  23.         /**
  24.         * @var string $ws_id
  25.         *
  26.         * @ORM\Column(type="string", nullable=true)
  27.         */
  28.         protected $ws_id;
  29.         /**
  30.         * @var string $account_id
  31.         *
  32.         * @ORM\Column(type="string", nullable=true)
  33.         */
  34.         protected $account_id;
  35.         /**
  36.         * @var string $tasks
  37.         *
  38.         * @ORM\Column(type="string", nullable=true)
  39.         */
  40.         protected $tasks;
  41.         /**
  42.         * @var \App\Entity\SonataUserUser $user
  43.         *
  44.         * @ORM\ManyToOne(targetEntity="App\Entity\SonataUserUser", inversedBy="orders")
  45.         * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  46.         */
  47.         private $user;
  48.         /**
  49.         * @ORM\OneToMany(targetEntity = "App\Entity\OrderProduct", mappedBy="order")
  50.         */
  51.         protected $products;
  52.         /**
  53.         * @var string $status
  54.         *
  55.         * @ORM\Column(type="string", nullable=true)
  56.         */
  57.         protected $status;
  58.         /**
  59.         * @var string $status_msg
  60.         *
  61.         * @ORM\Column(type="string", nullable=true)
  62.         */
  63.         protected $status_msg;
  64.         /**
  65.         * @var string $file_name
  66.         *
  67.         * @ORM\Column(type="string", nullable=true)
  68.         */
  69.         protected $file_name;
  70.         /**
  71.         * @var string $contact_name
  72.         *
  73.         * @ORM\Column(type="string", nullable=true)
  74.         */
  75.         protected $contact_name;
  76.         /**
  77.         * @var string $contact_phone
  78.         *
  79.         * @ORM\Column(type="string", nullable=true)
  80.         */
  81.         protected $contact_phone;
  82.         /**
  83.         * @var string $contact_city
  84.         *
  85.         * @ORM\Column(type="string", nullable=true)
  86.         */
  87.         protected $contact_city;
  88.         /**
  89.         * @var string $contact_address
  90.         *
  91.         * @ORM\Column(type="string", nullable=true)
  92.         */
  93.         protected $contact_address;
  94.         /**
  95.          * @var string $create_at
  96.          *
  97.          * @Gedmo\Timestampable(on="create")
  98.          * @ORM\Column(type="datetime", nullable=true)
  99.          */
  100.         protected $create_at;
  101.         /**
  102.          * @var string $update_at
  103.          *
  104.          * @Gedmo\Timestampable(on="update")
  105.          * @ORM\Column(type="datetime", nullable=true)
  106.          */
  107.         protected $update_at;
  108.         public function __construct()
  109.         {
  110.             $this->products = new ArrayCollection();
  111.         }
  112.         public function __toString(): string
  113.         {
  114. //            return $this->name;
  115.         }
  116.         public function getId(): ?int
  117.         {
  118.             return $this->id;
  119.         }
  120.         public function getCreateAt(): ?\DateTimeInterface
  121.         {
  122.             return $this->create_at;
  123.         }
  124.         public function setCreateAt(?\DateTimeInterface $create_at): static
  125.         {
  126.             $this->create_at $create_at;
  127.             return $this;
  128.         }
  129.         public function getUpdateAt(): ?\DateTimeInterface
  130.         {
  131.             return $this->update_at;
  132.         }
  133.         public function setUpdateAt(?\DateTimeInterface $update_at): static
  134.         {
  135.             $this->update_at $update_at;
  136.             return $this;
  137.         }
  138.         public function getUser(): ?SonataUserUser
  139.         {
  140.             return $this->user;
  141.         }
  142.         public function setUser(?SonataUserUser $user): static
  143.         {
  144.             $this->user $user;
  145.             return $this;
  146.         }
  147.         /**
  148.          * @return Collection<int, OrderProduct>
  149.          */
  150.         public function getProducts(): Collection
  151.         {
  152.             return $this->products;
  153.         }
  154.         public function addProduct(OrderProduct $product): static
  155.         {
  156.             if (!$this->products->contains($product)) {
  157.                 $this->products->add($product);
  158.                 $product->setOrder($this);
  159.             }
  160.             return $this;
  161.         }
  162.         public function removeProduct(OrderProduct $product): static
  163.         {
  164.             if ($this->products->removeElement($product)) {
  165.                 // set the owning side to null (unless already changed)
  166.                 if ($product->getOrder() === $this) {
  167.                     $product->setOrder(null);
  168.                 }
  169.             }
  170.             return $this;
  171.         }
  172.         public function getStatus(): ?string
  173.         {
  174.             return $this->status;
  175.         }
  176.         public function setStatus(?string $status): static
  177.         {
  178.             $this->status $status;
  179.             return $this;
  180.         }
  181.         public function getStatusMsg(): ?string
  182.         {
  183.             return $this->status_msg;
  184.         }
  185.         public function setStatusMsg(?string $status_msg): static
  186.         {
  187.             $this->status_msg $status_msg;
  188.             return $this;
  189.         }
  190.         public function getWsId(): ?string
  191.         {
  192.             return $this->ws_id;
  193.         }
  194.         public function setWsId(?string $ws_id): static
  195.         {
  196.             $this->ws_id $ws_id;
  197.             return $this;
  198.         }
  199.         public function getAccountId(): ?string
  200.         {
  201.             return $this->account_id;
  202.         }
  203.         public function setAccountId(?string $account_id): static
  204.         {
  205.             $this->account_id $account_id;
  206.             return $this;
  207.         }
  208.         public function getTasks(): ?string
  209.         {
  210.             return $this->tasks;
  211.         }
  212.         public function setTasks(?string $tasks): static
  213.         {
  214.             $this->tasks $tasks;
  215.             return $this;
  216.         }
  217.         public function getContactName(): ?string
  218.         {
  219.             return $this->contact_name;
  220.         }
  221.         public function setContactName(?string $contact_name): static
  222.         {
  223.             $this->contact_name $contact_name;
  224.             return $this;
  225.         }
  226.         public function getContactPhone(): ?string
  227.         {
  228.             return $this->contact_phone;
  229.         }
  230.         public function setContactPhone(?string $contact_phone): static
  231.         {
  232.             $this->contact_phone $contact_phone;
  233.             return $this;
  234.         }
  235.         public function getContactCity(): ?string
  236.         {
  237.             return $this->contact_city;
  238.         }
  239.         public function setContactCity(?string $contact_city): static
  240.         {
  241.             $this->contact_city $contact_city;
  242.             return $this;
  243.         }
  244.         public function getContactAddress(): ?string
  245.         {
  246.             return $this->contact_address;
  247.         }
  248.         public function setContactAddress(?string $contact_address): static
  249.         {
  250.             $this->contact_address $contact_address;
  251.             return $this;
  252.         }
  253.         public function getFileName(): ?string
  254.         {
  255.             return $this->file_name;
  256.         }
  257.         public function setFileName(?string $file_name): static
  258.         {
  259.             $this->file_name $file_name;
  260.             return $this;
  261.         }
  262. }