src/Entity/Orders.php line 59

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