src/Model/ViewOrder/ViewOrder.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Model\ViewOrder;
  3. use App\Model\Traits\ImportableObjectTrait;
  4. use App\Model\ViewOrderInfo\ViewOrderInfo;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Symfony\Component\Serializer\Annotation\MaxDepth;
  9. class ViewOrder
  10. {
  11.     const VIEWORDER_PROSPECT 'Prospect';
  12.     const VIEWORDER_QUOTE 'Quote';
  13.     const VIEWORDER_TASK 'Task';
  14.     const VIEWORDER_CONTACT 'Contact';
  15.     const VIEWORDER_MAILTYPE 'MailType';
  16.     const VIEWORDER_UNIT_MAILING 'unitMail';
  17.     const VIEWORDER_PRODUCT 'Product';
  18.     const VIEWORDER_TYPE_FORM 'form';
  19.     const VIEWORDER_TYPE_SEARCH 'search';
  20.     const VIEWORDER_LIST 'list';
  21.     use ImportableObjectTrait;
  22.     /**
  23.      * @var string|null
  24.      * @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:update"})
  25.      */
  26.     private $id;
  27.     /**
  28.      * @var string|null
  29.      * @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
  30.      */
  31.     private $entity;
  32.     /**
  33.      * @var string|null
  34.      * @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
  35.      */
  36.     private $customerId;
  37.     /**
  38.      * @var string|null
  39.      * @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
  40.      */
  41.     private $userId;
  42.     /**
  43.      * @var ViewOrderInfo[]|Collection
  44.      * @MaxDepth(5)
  45.      * @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
  46.      */
  47.     private $viewOrderInfos;
  48.     /**
  49.      * ViewOrderInfo constructor.
  50.      */
  51.     public function __construct()
  52.     {
  53.         $this->viewOrderInfos = new ArrayCollection();
  54.     }
  55.     /**
  56.      * @return string|null
  57.      */
  58.     public function getId(): ?string
  59.     {
  60.         return $this->id;
  61.     }
  62.     /**
  63.      * @param string|null $id
  64.      *
  65.      * @return ViewOrder
  66.      */
  67.     public function setId(?string $id): ViewOrder
  68.     {
  69.         $this->id $id;
  70.         return $this;
  71.     }
  72.     /**
  73.      * @return string|null
  74.      */
  75.     public function getEntity(): ?string
  76.     {
  77.         return $this->entity;
  78.     }
  79.     /**
  80.      * @param string|null $entity
  81.      *
  82.      * @return ViewOrder
  83.      */
  84.     public function setEntity(?string $entity): ViewOrder
  85.     {
  86.         $this->entity $entity;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return string|null
  91.      */
  92.     public function getCustomerId(): ?string
  93.     {
  94.         return $this->customerId;
  95.     }
  96.     /**
  97.      * @param string|null $customerId
  98.      *
  99.      * @return ViewOrder
  100.      */
  101.     public function setCustomerId(?string $customerId): ViewOrder
  102.     {
  103.         $this->customerId $customerId;
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return ViewOrderInfo[]|Collection
  108.      */
  109.     public function getViewOrderInfos(): ?Collection
  110.     {
  111.         return $this->viewOrderInfos;
  112.     }
  113.     /**
  114.      * Add a children viewOrderInfo object.
  115.      *
  116.      * @param ViewOrderInfo $children
  117.      */
  118.     public function addViewOrderInfo(ViewOrderInfo $children)
  119.     {
  120.         if (!$this->getViewOrderInfos()->contains($children)) {
  121.             $children->setViewOrder($this);
  122.             $this->getViewOrderInfos()->add($children);
  123.         }
  124.     }
  125.     /**
  126.      * Add a children viewOrderInfo object without setting the link.
  127.      *
  128.      * @param ViewOrderInfo $children
  129.      */
  130.     public function addViewOrderInfoWithoutLink(ViewOrderInfo $children)
  131.     {
  132.         if (!$this->getViewOrderInfos()->contains($children)) {
  133.             $this->getViewOrderInfos()->add($children);
  134.         }
  135.     }
  136.     /**
  137.      * Remove a children viewOrderInfo object.
  138.      *
  139.      * @param ViewOrderInfo $children
  140.      */
  141.     public function removeViewOrderInfo(ViewOrderInfo $children)
  142.     {
  143.         if ($this->getViewOrderInfos()->contains($children)) {
  144.             $children->setViewOrder(null);
  145.             $this->getViewOrderInfos()->removeElement($children);
  146.         }
  147.     }
  148.     /**
  149.      * @return string|null
  150.      */
  151.     public function getUserId(): ?string
  152.     {
  153.         return $this->userId;
  154.     }
  155.     /**
  156.      * @param string|null $userId
  157.      *
  158.      * @return ViewOrder
  159.      */
  160.     public function setUserId(?string $userId): ViewOrder
  161.     {
  162.         $this->userId $userId;
  163.         return $this;
  164.     }
  165. }