src/Entity/Orders.php line 59

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\OrdersRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. use ApiPlatform\Metadata\ApiFilter;
  11. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  12. use ApiPlatform\Core\Annotation\ApiProperty;
  13. use Symfony\Component\Serializer\Annotation\MaxDepth;
  14. use ApiPlatform\Metadata\Get;
  15. use ApiPlatform\Metadata\GetCollection;
  16. use ApiPlatform\Metadata\Delete;
  17. use ApiPlatform\Metadata\Put;
  18. use ApiPlatform\Metadata\Post;
  19. use App\Controller\OrdersController;
  20. #[ORM\Entity(repositoryClassOrdersRepository::class)]
  21. #[ApiResource(
  22.     operations: [
  23.         new Get(),
  24.         new Post(),
  25.         new Delete(),
  26.         new GetCollection(),
  27.         new Put(),
  28.         new Post(
  29.             name'synced_orders'
  30.             uriTemplate'/orders/synced'
  31.             controllerOrdersController::class
  32.         )
  33.     ],
  34.     normalizationContext: ['groups' => ['order:read''order_product:write']],
  35.     denormalizationContext: ['groups' => ['order:write']],
  36.     order: ['id' => 'DESC'],
  37. )] 
  38. #[ApiFilter(
  39.     SearchFilter::class, 
  40.     properties: [
  41.         'code1c' => 'exact'
  42.         'synced' => 'exact'
  43.         'status' => 'exact'
  44.         'createdIn' => 'exact'
  45.         'account.name' => 'ipartial',
  46.         'account.manager' => 'exact'
  47.         'account.user' => 'exact'
  48.         'manager.username' => 'ipartial'
  49.         'manager.firstName' => 'ipartial'
  50.         'manager.lastName' => 'ipartial'
  51.     ]
  52. )]
  53. #[ORM\HasLifecycleCallbacks]
  54. class Orders
  55. {
  56.     #[Groups(['order:read''order_product:read''order_product:write','load_invoice:read''order:write''media_object:read''agreements:read''pre_order_product:read''pre_order:read'])]
  57.     #[ORM\Id]
  58.     #[ORM\GeneratedValue]
  59.     #[ORM\Column]
  60.     private ?int $id null;
  61.     #[Groups(['order:read''order_product:read''order_product:write','load_invoice:read''order:write''media_object:read''agreements:read''pre_order_product:read''pre_order:read'])]
  62.     #[ORM\Column(length255nullabletrue)]
  63.     private ?string $name null;
  64.     #[Groups(['order:read''order_product:read''order_product:write','load_invoice:read''order:write','media_object:read''pre_order_product:read''pre_order:read'])]
  65.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  66.     private ?\DateTimeInterface $dateEntered null;
  67.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  68.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  69.     private ?\DateTimeInterface $dateModified null;
  70.     #[ORM\Column(nullabletrue)]
  71.     private ?int $created_by null;
  72.     #[ORM\Column(nullabletrue)]
  73.     private ?int $modified_user_id null;
  74.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read'])]
  75.     #[ORM\ManyToOne(inversedBy'orders')]
  76.     private ?User $client null;
  77.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  78.     #[ORM\ManyToOne(inversedBy'managerOrders')]
  79.     private ?User $manager null;
  80.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  81.     #[ORM\ManyToOne(inversedBy'orders')]
  82.     private ?Accounts $account null;
  83.     #[Groups(['order:read''order_product:read''order_product:write','load_invoice:read''order:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  84.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  85.     private ?\DateTimeInterface $dateOrder null;
  86.     #[Groups(['order:read''order_product:read''order_product:write','load_invoice:read''order:write''pre_order_product:read''pre_order:read'])]
  87.     #[ORM\Column(length100nullabletrue)]
  88.     private ?string $status null;
  89.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read'])]
  90.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  91.     private ?string $description null;
  92.     #[Groups(['order:read''order_product:read''order_product:write''load_invoice:read''order:write''pre_order_product:read''pre_order:read'])]
  93.     #[ORM\Column(length20nullabletrue)]
  94.     private ?string $paymentMethod null;
  95.     #[Groups(['order:read''order_product:read''order_product:write''load_invoice:read',  'order:write''pre_order_product:read''pre_order:read'])]
  96.     #[ORM\Column(nullabletrue)]
  97.     private ?float $sumOrdered null;
  98.     #[Groups(['order:read''order_product:read''order_product:write''load_invoice:read''order:write''media_object:read''agreements:read''pre_order_product:read''pre_order:read'])]
  99.     #[ORM\Column(length20nullabletrue)]
  100.     private ?string $code1c null;
  101.     #[Groups(['order:read''order_product:read''order_product:write''load_invoice:read',  'order:write'])]
  102.     #[ORM\Column(length10nullabletrue)]
  103.     private ?string $curency null;
  104.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  105.     #[ORM\Column(nullabletrue)]
  106.     private ?float $curencyRate null;
  107.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  108.     #[ORM\Column(nullabletrue)]
  109.     private ?float $discountTotal null;
  110.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  111.     #[ORM\Column(nullabletrue)]
  112.     private ?int $discount_percent null;
  113.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  114.     #[ORM\Column(length100nullabletrue)]
  115.     private ?string $shippingAddressStreet null;
  116.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  117.     #[ORM\Column(length100nullabletrue)]
  118.     private ?string $shippingAddressCity null;
  119.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  120.     #[ORM\Column(length100nullabletrue)]
  121.     private ?string $shippingAddressBuilding null;
  122.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  123.     #[ORM\Column(length100nullabletrue)]
  124.     private ?string $shippingAddressPost null;
  125.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  126.     #[ORM\Column(length100nullabletrue)]
  127.     private ?string $shippingAddressCountry null;
  128.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  129.     #[ORM\Column(length100nullabletrue)]
  130.     private ?string $shippingAddressDate null;
  131.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  132.     #[ORM\Column(nullabletrue)]
  133.     private ?int $copyOrderId null;
  134.     #[ApiProperty(writabletrue)]
  135.     #[Groups(['order:read''order:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  136.     #[ORM\OneToMany(mappedBy'order'targetEntityOrderProduct::class, cascade:['persist''remove'])]
  137.     #[MaxDepth(4)]
  138.     private Collection $orderProducts;
  139.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  140.     #[ORM\ManyToOne(inversedBy'orders')]
  141.     private ?Storage $storage null;
  142.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  143.     #[ORM\Column(length20nullabletrue)]
  144.     private ?string $shippingMethod null;
  145.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  146.     #[ORM\Column(length20nullabletrue)]
  147.     private ?string $dovirenistSeries null;
  148.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  149.     #[ORM\Column(length100nullabletrue)]
  150.     private ?string $dovirenistNumber null;
  151.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  152.     #[ORM\Column(nullabletrue)]
  153.     private ?bool $isGot null;
  154.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  155.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  156.     private ?\DateTimeInterface $dovirenistDate null;
  157.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  158.     #[ORM\ManyToOne]
  159.     private ?User $releaseAllowed null;
  160.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  161.     #[ORM\Column(nullabletrue)]
  162.     private ?bool $isReleaseAllowed null;
  163.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  164.     #[ORM\Column(nullabletrue)]
  165.     private ?bool $isChecked null;
  166.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  167.     #[ORM\ManyToOne]
  168.     private ?User $checked null;
  169.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  170.     #[ORM\Column(length255nullabletrue)]
  171.     private ?string $carrier null;
  172.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  173.     #[ORM\Column(length10nullabletrue)]
  174.     private ?string $id_1c null;
  175.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  176.     #[ORM\Column(nullabletrue)]
  177.     private ?float $sumTransport null;
  178.     #[Groups(['order:read''order_product:read''order_product:write''order:write''load_invoice:read'])]
  179.     #[ORM\ManyToOne(inversedBy'orders')]
  180.     private ?PreOrder $preOrder null;
  181.     // #[ORM\ManyToOne(inversedBy: 'orders')]
  182.     // private ?LoadInvoice $load_invoice = null;
  183.     // #[ORM\OneToMany(mappedBy: '_order', targetEntity: LoadInvoice::class)]
  184.     // private Collection $loadInvoices;
  185.     #[Groups(['order:read''order_product:read''order_product:write''order:write'])]
  186.     #[ORM\OneToMany(mappedBy'order'targetEntityAccepted::class)]
  187.     private Collection $accepteds;
  188.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read'])]
  189.     #[ORM\ManyToMany(targetEntityLoadInvoice::class, inversedBy'orders')]
  190.     private Collection $loadInvoice;
  191.     #[ORM\OneToMany(mappedBy'orders'targetEntityCalculations::class)]
  192.     private Collection $calculations;
  193.     #[Groups(['order:read''order_product:read''order_product:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  194.     #[ORM\OneToMany(mappedBy'orders'targetEntityMediaObject::class)]
  195.     private Collection $mediaObjects;
  196.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  197.     #[ORM\Column(nullabletrue)]
  198.     private ?bool $synced null;
  199.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  200.     #[ORM\ManyToOne(inversedBy'orders')]
  201.     private ?Agreements $agreement null;
  202.     
  203.     #[Groups(['order:read''order_product:read''order_product:write''order:write''pre_order_product:read''pre_order:read''load_invoice:read'])]
  204.     #[ORM\Column(length100nullabletrue)]
  205.     private ?string $createdIn 'crm';
  206.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'parentOrders')]
  207.     private ?self $parent null;
  208.     #[ORM\OneToMany(mappedBy'parent'targetEntityself::class)]
  209.     private Collection $parentOrders;
  210.     #[Groups(['order:read','order:write'])]
  211.     #[ORM\ManyToOne(inversedBy'orders')]
  212.     private ?AccountAddress $address null;
  213.     public function __construct()
  214.     {
  215.         $this->orderProducts = new ArrayCollection();
  216.         // $this->loadInvoices = new ArrayCollection();
  217.         $this->accepteds = new ArrayCollection();
  218.         $this->loadInvoice = new ArrayCollection();
  219.         $this->calculations = new ArrayCollection();
  220.         $this->mediaObjects = new ArrayCollection();
  221.         $this->parentOrders = new ArrayCollection();
  222.     }
  223.     public function getId(): ?int
  224.     {
  225.         return $this->id;
  226.     }
  227.     public function setId(?string $id): self
  228.     {
  229.         $this->id $id;
  230.         return $this;
  231.     }
  232.     public function getName(): ?string
  233.     {
  234.         return $this->name;
  235.     }
  236.     public function setName(?string $name): self
  237.     {
  238.         $this->name $name;
  239.         return $this;
  240.     }
  241.     public function getDateEntered(): ?\DateTimeInterface
  242.     {
  243.         return $this->dateEntered;
  244.     }
  245.     public function setDateEntered(?\DateTimeInterface $dateEntered): self
  246.     {
  247.         $this->dateEntered $dateEntered;
  248.         return $this;
  249.     }
  250.     public function getDateModified(): ?\DateTimeInterface
  251.     {
  252.         return $this->dateModified;
  253.     }
  254.     public function setDateModified(?\DateTimeInterface $dateModified): self
  255.     {
  256.         $this->dateModified $dateModified;
  257.         return $this;
  258.     }
  259.     public function getCreatedBy(): ?int
  260.     {
  261.         return $this->created_by;
  262.     }
  263.     public function setCreatedBy(?int $created_by): self
  264.     {
  265.         $this->created_by $created_by;
  266.         return $this;
  267.     }
  268.     public function getModifiedUserId(): ?int
  269.     {
  270.         return $this->modified_user_id;
  271.     }
  272.     public function setModifiedUserId(?int $modified_user_id): self
  273.     {
  274.         $this->modified_user_id $modified_user_id;
  275.         return $this;
  276.     }
  277.     public function getClient(): ?User
  278.     {
  279.         return $this->client;
  280.     }
  281.     public function setClient(?User $client): self
  282.     {
  283.         $this->client $client;
  284.         return $this;
  285.     }
  286.     public function getManager(): ?User
  287.     {
  288.         return $this->manager;
  289.     }
  290.     public function setManager(?User $manager): self
  291.     {
  292.         $this->manager $manager;
  293.         return $this;
  294.     }
  295.     public function getAccount(): ?Accounts
  296.     {
  297.         return $this->account;
  298.     }
  299.     public function setAccount(?Accounts $account): self
  300.     {
  301.         $this->account $account;
  302.         return $this;
  303.     }
  304.     public function getDateOrder(): ?\DateTimeInterface
  305.     {
  306.         return $this->dateOrder;
  307.     }
  308.     public function setDateOrder(?\DateTimeInterface $dateOrder): self
  309.     {
  310.         $this->dateOrder $dateOrder;
  311.         return $this;
  312.     }
  313.     public function getStatus(): ?string
  314.     {
  315.         return $this->status;
  316.     }
  317.     public function setStatus(?string $status): self
  318.     {
  319.         $this->status $status;
  320.         return $this;
  321.     }
  322.     public function getDescription(): ?string
  323.     {
  324.         return $this->description;
  325.     }
  326.     public function setDescription(?string $description): self
  327.     {
  328.         $this->description $description;
  329.         return $this;
  330.     }
  331.     public function getPaymentMethod(): ?string
  332.     {
  333.         return $this->paymentMethod;
  334.     }
  335.     public function setPaymentMethod(?string $paymentMethod): self
  336.     {
  337.         $this->paymentMethod $paymentMethod;
  338.         return $this;
  339.     }
  340.     public function getSumOrdered(): ?float
  341.     {
  342.         return $this->sumOrdered;
  343.     }
  344.     public function setSumOrdered(?float $sumOrdered): self
  345.     {
  346.         $this->sumOrdered $sumOrdered;
  347.         return $this;
  348.     }
  349.     public function getCode1c(): ?string
  350.     {
  351.         return $this->code1c;
  352.     }
  353.     public function setCode1c(?string $code1c): self
  354.     {
  355.         $this->code1c $code1c;
  356.         return $this;
  357.     }
  358.     public function getCurency(): ?string
  359.     {
  360.         return $this->curency;
  361.     }
  362.     public function setCurency(?string $curency): self
  363.     {
  364.         $this->curency $curency;
  365.         return $this;
  366.     }
  367.     public function getCurencyRate(): ?float
  368.     {
  369.         return $this->curencyRate;
  370.     }
  371.     public function setCurencyRate(?float $curencyRate): self
  372.     {
  373.         $this->curencyRate $curencyRate;
  374.         return $this;
  375.     }
  376.     public function getDiscountTotal(): ?float
  377.     {
  378.         return $this->discountTotal;
  379.     }
  380.     public function setDiscountTotal(?float $discountTotal): self
  381.     {
  382.         $this->discountTotal $discountTotal;
  383.         return $this;
  384.     }
  385.     public function getDiscountPercent(): ?int
  386.     {
  387.         return $this->discount_percent;
  388.     }
  389.     public function setDiscountPercent(?int $discount_percent): self
  390.     {
  391.         $this->discount_percent $discount_percent;
  392.         return $this;
  393.     }
  394.     public function getShippingAddressStreet(): ?string
  395.     {
  396.         return $this->shippingAddressStreet;
  397.     }
  398.     public function setShippingAddressStreet(?string $shippingAddressStreet): self
  399.     {
  400.         $this->shippingAddressStreet $shippingAddressStreet;
  401.         return $this;
  402.     }
  403.     public function getShippingAddressCity(): ?string
  404.     {
  405.         return $this->shippingAddressCity;
  406.     }
  407.     public function setShippingAddressCity(?string $shippingAddressCity): self
  408.     {
  409.         $this->shippingAddressCity $shippingAddressCity;
  410.         return $this;
  411.     }
  412.     public function getShippingAddressBuilding(): ?string
  413.     {
  414.         return $this->shippingAddressBuilding;
  415.     }
  416.     public function setShippingAddressBuilding(?string $shippingAddressBuilding): self
  417.     {
  418.         $this->shippingAddressBuilding $shippingAddressBuilding;
  419.         return $this;
  420.     }
  421.     public function getShippingAddressPost(): ?string
  422.     {
  423.         return $this->shippingAddressPost;
  424.     }
  425.     public function setShippingAddressPost(?string $shippingAddressPost): self
  426.     {
  427.         $this->shippingAddressPost $shippingAddressPost;
  428.         return $this;
  429.     }
  430.     public function getShippingAddressCountry(): ?string
  431.     {
  432.         return $this->shippingAddressCountry;
  433.     }
  434.     public function setShippingAddressCountry(?string $shippingAddressCountry): self
  435.     {
  436.         $this->shippingAddressCountry $shippingAddressCountry;
  437.         return $this;
  438.     }
  439.     public function getShippingAddressDate(): ?string
  440.     {
  441.         return $this->shippingAddressDate;
  442.     }
  443.     public function setShippingAddressDate(?string $shippingAddressDate): self
  444.     {
  445.         $this->shippingAddressDate $shippingAddressDate;
  446.         return $this;
  447.     }
  448.     public function getCopyOrderId(): ?int
  449.     {
  450.         return $this->copyOrderId;
  451.     }
  452.     public function setCopyOrderId(?int $copyOrderId): self
  453.     {
  454.         $this->copyOrderId $copyOrderId;
  455.         return $this;
  456.     }
  457.     /**
  458.      * @return Collection<int, OrderProduct>
  459.      */
  460.     public function getOrderProducts(): Collection
  461.     {
  462.         return $this->orderProducts;
  463.     }
  464.     public function addOrderProduct(OrderProduct $orderProduct): self
  465.     {
  466.         if (!$this->orderProducts->contains($orderProduct)) {
  467.             $this->orderProducts->add($orderProduct);
  468.             $orderProduct->setOrder($this);
  469.         }
  470.         return $this;
  471.     }
  472.     public function removeOrderProduct(OrderProduct $orderProduct): self
  473.     {
  474.         if ($this->orderProducts->removeElement($orderProduct)) {
  475.             // set the owning side to null (unless already changed)
  476.             if ($orderProduct->getOrder() === $this) {
  477.                 $orderProduct->setOrder(null);
  478.             }
  479.         }
  480.         return $this;
  481.     }
  482.     public function getStorage(): ?Storage
  483.     {
  484.         return $this->storage;
  485.     }
  486.     public function setStorage(?Storage $storage): self
  487.     {
  488.         $this->storage $storage;
  489.         return $this;
  490.     }
  491.     public function getShippingMethod(): ?string
  492.     {
  493.         return $this->shippingMethod;
  494.     }
  495.     public function setShippingMethod(?string $shippingMethod): self
  496.     {
  497.         $this->shippingMethod $shippingMethod;
  498.         return $this;
  499.     }
  500.     public function getDovirenistSeries(): ?string
  501.     {
  502.         return $this->dovirenistSeries;
  503.     }
  504.     public function setDovirenistSeries(?string $dovirenistSeries): self
  505.     {
  506.         $this->dovirenistSeries $dovirenistSeries;
  507.         return $this;
  508.     }
  509.     public function getDovirenistNumber(): ?string
  510.     {
  511.         return $this->dovirenistNumber;
  512.     }
  513.     public function setDovirenistNumber(?string $dovirenistNumber): self
  514.     {
  515.         $this->dovirenistNumber $dovirenistNumber;
  516.         return $this;
  517.     }
  518.     public function isIsGot(): ?bool
  519.     {
  520.         return $this->isGot;
  521.     }
  522.     public function setIsGot(?bool $isGot): self
  523.     {
  524.         $this->isGot $isGot;
  525.         return $this;
  526.     }
  527.     public function getDovirenistDate(): ?\DateTimeInterface
  528.     {
  529.         return $this->dovirenistDate;
  530.     }
  531.     public function setDovirenistDate(?\DateTimeInterface $dovirenistDate): self
  532.     {
  533.         $this->dovirenistDate $dovirenistDate;
  534.         return $this;
  535.     }
  536.     public function getReleaseAllowed(): ?User
  537.     {
  538.         return $this->releaseAllowed;
  539.     }
  540.     public function setReleaseAllowed(?User $releaseAllowed): self
  541.     {
  542.         $this->releaseAllowed $releaseAllowed;
  543.         return $this;
  544.     }
  545.     public function isIsReleaseAllowed(): ?bool
  546.     {
  547.         return $this->isReleaseAllowed;
  548.     }
  549.     public function setIsReleaseAllowed(?bool $isReleaseAllowed): self
  550.     {
  551.         $this->isReleaseAllowed $isReleaseAllowed;
  552.         return $this;
  553.     }
  554.     public function getIsChecked(): ?bool
  555.     {
  556.         return $this->isChecked;
  557.     }
  558.     public function setIsChecked(?bool $isChecked): self
  559.     {
  560.         $this->isChecked $isChecked;
  561.         return $this;
  562.     }
  563.     public function getChecked(): ?User
  564.     {
  565.         return $this->checked;
  566.     }
  567.     public function setChecked(?User $checked): self
  568.     {
  569.         $this->checked $checked;
  570.         return $this;
  571.     }
  572.     public function getCarrier(): ?string
  573.     {
  574.         return $this->carrier;
  575.     }
  576.     public function setCarrier(?string $carrier): self
  577.     {
  578.         $this->carrier $carrier;
  579.         return $this;
  580.     }
  581.     public function getId1c(): ?string
  582.     {
  583.         return $this->id_1c;
  584.     }
  585.     public function setId1c(?string $id_1c): self
  586.     {
  587.         $this->id_1c $id_1c;
  588.         return $this;
  589.     }
  590.     public function getSumTransport(): ?float
  591.     {
  592.         return $this->sumTransport;
  593.     }
  594.     public function setSumTransport(?float $sumTransport): self
  595.     {
  596.         $this->sumTransport $sumTransport;
  597.         return $this;
  598.     }
  599.     public function getPreOrder(): ?PreOrder
  600.     {
  601.         return $this->preOrder;
  602.     }
  603.     public function setPreOrder(?PreOrder $preOrder): self
  604.     {
  605.         $this->preOrder $preOrder;
  606.         return $this;
  607.     }
  608.     // public function getLoadInvoice(): ?LoadInvoice
  609.     // {
  610.     //     return $this->load_invoice;
  611.     // }
  612.     // public function setLoadInvoice(?LoadInvoice $load_invoice): self
  613.     // {
  614.     //     $this->load_invoice = $load_invoice;
  615.     //     return $this;
  616.     // }
  617.     /**
  618.      * @return Collection<int, LoadInvoice>
  619.      */
  620.     // public function getLoadInvoices(): Collection
  621.     // {
  622.     //     return $this->loadInvoices;
  623.     // }
  624.     // public function addLoadInvoice(LoadInvoice $loadInvoice): self
  625.     // {
  626.     //     if (!$this->loadInvoices->contains($loadInvoice)) {
  627.     //         $this->loadInvoices->add($loadInvoice);
  628.     //         $loadInvoice->setOrder($this);
  629.     //     }
  630.     //     return $this;
  631.     // }
  632.     // public function removeLoadInvoice(LoadInvoice $loadInvoice): self
  633.     // {
  634.     //     if ($this->loadInvoices->removeElement($loadInvoice)) {
  635.     //         // set the owning side to null (unless already changed)
  636.     //         if ($loadInvoice->getOrder() === $this) {
  637.     //             $loadInvoice->setOrder(null);
  638.     //         }
  639.     //     }
  640.     //     return $this;
  641.     // }
  642.     /**
  643.      * @return Collection<int, Accepted>
  644.      */
  645.     public function getAccepteds(): Collection
  646.     {
  647.         return $this->accepteds;
  648.     }
  649.     public function addAccepted(Accepted $accepted): self
  650.     {
  651.         if (!$this->accepteds->contains($accepted)) {
  652.             $this->accepteds->add($accepted);
  653.             $accepted->setOrder($this);
  654.         }
  655.         return $this;
  656.     }
  657.     public function removeAccepted(Accepted $accepted): self
  658.     {
  659.         if ($this->accepteds->removeElement($accepted)) {
  660.             // set the owning side to null (unless already changed)
  661.             if ($accepted->getOrder() === $this) {
  662.                 $accepted->setOrder(null);
  663.             }
  664.         }
  665.         return $this;
  666.     }
  667.     /**
  668.      * @return Collection<int, LoadInvoice>
  669.      */
  670.     public function getLoadInvoice(): Collection
  671.     {
  672.         return $this->loadInvoice;
  673.     }
  674.     public function addLoadInvoice(LoadInvoice $loadInvoice): self
  675.     {
  676.         if (!$this->loadInvoice->contains($loadInvoice)) {
  677.             $this->loadInvoice->add($loadInvoice);
  678.         }
  679.         return $this;
  680.     }
  681.     public function removeLoadInvoice(LoadInvoice $loadInvoice): self
  682.     {
  683.         $this->loadInvoice->removeElement($loadInvoice);
  684.         return $this;
  685.     }
  686.     /**
  687.      * @return Collection<int, Calculations>
  688.      */
  689.     public function getCalculations(): Collection
  690.     {
  691.         return $this->calculations;
  692.     }
  693.     public function addCalculation(Calculations $calculation): self
  694.     {
  695.         if (!$this->calculations->contains($calculation)) {
  696.             $this->calculations->add($calculation);
  697.             $calculation->setOrders($this);
  698.         }
  699.         return $this;
  700.     }
  701.     public function removeCalculation(Calculations $calculation): self
  702.     {
  703.         if ($this->calculations->removeElement($calculation)) {
  704.             // set the owning side to null (unless already changed)
  705.             if ($calculation->getOrders() === $this) {
  706.                 $calculation->setOrders(null);
  707.             }
  708.         }
  709.         return $this;
  710.     }
  711.     /**
  712.      * @return Collection<int, MediaObject>
  713.      */
  714.     public function getMediaObjects(): Collection
  715.     {
  716.         return $this->mediaObjects;
  717.     }
  718.     public function addMediaObject(MediaObject $mediaObject): self
  719.     {
  720.         if (!$this->mediaObjects->contains($mediaObject)) {
  721.             $this->mediaObjects->add($mediaObject);
  722.             $mediaObject->setOrders($this);
  723.         }
  724.         return $this;
  725.     }
  726.     public function removeMediaObject(MediaObject $mediaObject): self
  727.     {
  728.         if ($this->mediaObjects->removeElement($mediaObject)) {
  729.             // set the owning side to null (unless already changed)
  730.             if ($mediaObject->getOrders() === $this) {
  731.                 $mediaObject->setOrders(null);
  732.             }
  733.         }
  734.         return $this;
  735.     }
  736.     #[ORM\PrePersist]
  737.     public function setCreatedAtValue(): void
  738.     {
  739.         $this->dateEntered = new \DateTime();
  740.     }
  741.     // #[ORM\PrePersist]
  742.     #[ORM\PreUpdate]
  743.     public function setUpdatedAtValue(): void
  744.     {
  745.         $this->dateModified = new \DateTime();
  746.     }
  747.     public function isSynced(): ?bool
  748.     {
  749.         return $this->synced;
  750.     }
  751.     public function setSynced(?bool $synced): self
  752.     {
  753.         $this->synced $synced;
  754.         return $this;
  755.     }
  756.     public function getAgreement(): ?Agreements
  757.     {
  758.         return $this->agreement;
  759.     }
  760.     public function setAgreement(?Agreements $agreement): self
  761.     {
  762.         $this->agreement $agreement;
  763.         return $this;
  764.     }
  765.     public function getCreatedIn(): ?string
  766.     {
  767.         return $this->createdIn;
  768.     }
  769.     public function setCreatedIn(?string $createdIn): self
  770.     {
  771.         $this->createdIn $createdIn;
  772.         return $this;
  773.     }
  774.     public function getParent(): ?self
  775.     {
  776.         return $this->parent;
  777.     }
  778.     public function setParent(?self $parent): self
  779.     {
  780.         $this->parent $parent;
  781.         return $this;
  782.     }
  783.     /**
  784.      * @return Collection<int, self>
  785.      */
  786.     public function getParentOrders(): Collection
  787.     {
  788.         return $this->parentOrders;
  789.     }
  790.     public function addParentOrder(self $parentOrder): self
  791.     {
  792.         if (!$this->parentOrders->contains($parentOrder)) {
  793.             $this->parentOrders->add($parentOrder);
  794.             $parentOrder->setParent($this);
  795.         }
  796.         return $this;
  797.     }
  798.     public function removeParentOrder(self $parentOrder): self
  799.     {
  800.         if ($this->parentOrders->removeElement($parentOrder)) {
  801.             // set the owning side to null (unless already changed)
  802.             if ($parentOrder->getParent() === $this) {
  803.                 $parentOrder->setParent(null);
  804.             }
  805.         }
  806.         return $this;
  807.     }
  808.     public function getAddress(): ?AccountAddress
  809.     {
  810.         return $this->address;
  811.     }
  812.     public function setAddress(?AccountAddress $address): self
  813.     {
  814.         $this->address $address;
  815.         return $this;
  816.     }
  817. }