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']],
  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.     public function __construct()
  219.     {
  220.         $this->orderProducts = new ArrayCollection();
  221.         // $this->loadInvoices = new ArrayCollection();
  222.         $this->accepteds = new ArrayCollection();
  223.         $this->loadInvoice = new ArrayCollection();
  224.         $this->calculations = new ArrayCollection();
  225.         $this->mediaObjects = new ArrayCollection();
  226.         $this->parentOrders = new ArrayCollection();
  227.     }
  228.     public function getId(): ?int
  229.     {
  230.         return $this->id;
  231.     }
  232.     public function setId(?string $id): self
  233.     {
  234.         $this->id $id;
  235.         return $this;
  236.     }
  237.     public function getName(): ?string
  238.     {
  239.         return $this->name;
  240.     }
  241.     public function setName(?string $name): self
  242.     {
  243.         $this->name $name;
  244.         return $this;
  245.     }
  246.     public function getDateEntered(): ?\DateTimeInterface
  247.     {
  248.         return $this->dateEntered;
  249.     }
  250.     public function setDateEntered(?\DateTimeInterface $dateEntered): self
  251.     {
  252.         $this->dateEntered $dateEntered;
  253.         return $this;
  254.     }
  255.     public function getDateModified(): ?\DateTimeInterface
  256.     {
  257.         return $this->dateModified;
  258.     }
  259.     public function setDateModified(?\DateTimeInterface $dateModified): self
  260.     {
  261.         $this->dateModified $dateModified;
  262.         return $this;
  263.     }
  264.     public function getCreatedBy(): ?int
  265.     {
  266.         return $this->created_by;
  267.     }
  268.     public function setCreatedBy(?int $created_by): self
  269.     {
  270.         $this->created_by $created_by;
  271.         return $this;
  272.     }
  273.     public function getModifiedUserId(): ?int
  274.     {
  275.         return $this->modified_user_id;
  276.     }
  277.     public function setModifiedUserId(?int $modified_user_id): self
  278.     {
  279.         $this->modified_user_id $modified_user_id;
  280.         return $this;
  281.     }
  282.     public function getClient(): ?User
  283.     {
  284.         return $this->client;
  285.     }
  286.     public function setClient(?User $client): self
  287.     {
  288.         $this->client $client;
  289.         return $this;
  290.     }
  291.     public function getManager(): ?User
  292.     {
  293.         return $this->manager;
  294.     }
  295.     public function setManager(?User $manager): self
  296.     {
  297.         $this->manager $manager;
  298.         return $this;
  299.     }
  300.     public function getAccount(): ?Accounts
  301.     {
  302.         return $this->account;
  303.     }
  304.     public function setAccount(?Accounts $account): self
  305.     {
  306.         $this->account $account;
  307.         return $this;
  308.     }
  309.     public function getDateOrder(): ?\DateTimeInterface
  310.     {
  311.         return $this->dateOrder;
  312.     }
  313.     public function setDateOrder(?\DateTimeInterface $dateOrder): self
  314.     {
  315.         $this->dateOrder $dateOrder;
  316.         return $this;
  317.     }
  318.     public function getStatus(): ?string
  319.     {
  320.         return $this->status;
  321.     }
  322.     public function setStatus(?string $status): self
  323.     {
  324.         $this->status $status;
  325.         return $this;
  326.     }
  327.     public function getDescription(): ?string
  328.     {
  329.         return $this->description;
  330.     }
  331.     public function setDescription(?string $description): self
  332.     {
  333.         $this->description $description;
  334.         return $this;
  335.     }
  336.     public function getPaymentMethod(): ?string
  337.     {
  338.         return $this->paymentMethod;
  339.     }
  340.     public function setPaymentMethod(?string $paymentMethod): self
  341.     {
  342.         $this->paymentMethod $paymentMethod;
  343.         return $this;
  344.     }
  345.     public function getSumOrdered(): ?float
  346.     {
  347.         return $this->sumOrdered;
  348.     }
  349.     public function setSumOrdered(?float $sumOrdered): self
  350.     {
  351.         $this->sumOrdered $sumOrdered;
  352.         return $this;
  353.     }
  354.     public function getCode1c(): ?string
  355.     {
  356.         return $this->code1c;
  357.     }
  358.     public function setCode1c(?string $code1c): self
  359.     {
  360.         $this->code1c $code1c;
  361.         return $this;
  362.     }
  363.     public function getCurency(): ?string
  364.     {
  365.         return $this->curency;
  366.     }
  367.     public function setCurency(?string $curency): self
  368.     {
  369.         $this->curency $curency;
  370.         return $this;
  371.     }
  372.     public function getCurencyRate(): ?float
  373.     {
  374.         return $this->curencyRate;
  375.     }
  376.     public function setCurencyRate(?float $curencyRate): self
  377.     {
  378.         $this->curencyRate $curencyRate;
  379.         return $this;
  380.     }
  381.     public function getDiscountTotal(): ?float
  382.     {
  383.         return $this->discountTotal;
  384.     }
  385.     public function setDiscountTotal(?float $discountTotal): self
  386.     {
  387.         $this->discountTotal $discountTotal;
  388.         return $this;
  389.     }
  390.     public function getDiscountPercent(): ?int
  391.     {
  392.         return $this->discount_percent;
  393.     }
  394.     public function setDiscountPercent(?int $discount_percent): self
  395.     {
  396.         $this->discount_percent $discount_percent;
  397.         return $this;
  398.     }
  399.     public function getShippingAddressStreet(): ?string
  400.     {
  401.         return $this->shippingAddressStreet;
  402.     }
  403.     public function setShippingAddressStreet(?string $shippingAddressStreet): self
  404.     {
  405.         $this->shippingAddressStreet $shippingAddressStreet;
  406.         return $this;
  407.     }
  408.     public function getShippingAddressCity(): ?string
  409.     {
  410.         return $this->shippingAddressCity;
  411.     }
  412.     public function setShippingAddressCity(?string $shippingAddressCity): self
  413.     {
  414.         $this->shippingAddressCity $shippingAddressCity;
  415.         return $this;
  416.     }
  417.     public function getShippingAddressBuilding(): ?string
  418.     {
  419.         return $this->shippingAddressBuilding;
  420.     }
  421.     public function setShippingAddressBuilding(?string $shippingAddressBuilding): self
  422.     {
  423.         $this->shippingAddressBuilding $shippingAddressBuilding;
  424.         return $this;
  425.     }
  426.     public function getShippingAddressPost(): ?string
  427.     {
  428.         return $this->shippingAddressPost;
  429.     }
  430.     public function setShippingAddressPost(?string $shippingAddressPost): self
  431.     {
  432.         $this->shippingAddressPost $shippingAddressPost;
  433.         return $this;
  434.     }
  435.     public function getShippingAddressCountry(): ?string
  436.     {
  437.         return $this->shippingAddressCountry;
  438.     }
  439.     public function setShippingAddressCountry(?string $shippingAddressCountry): self
  440.     {
  441.         $this->shippingAddressCountry $shippingAddressCountry;
  442.         return $this;
  443.     }
  444.     public function getShippingAddressDate(): ?string
  445.     {
  446.         return $this->shippingAddressDate;
  447.     }
  448.     public function setShippingAddressDate(?string $shippingAddressDate): self
  449.     {
  450.         $this->shippingAddressDate $shippingAddressDate;
  451.         return $this;
  452.     }
  453.     public function getCopyOrderId(): ?int
  454.     {
  455.         return $this->copyOrderId;
  456.     }
  457.     public function setCopyOrderId(?int $copyOrderId): self
  458.     {
  459.         $this->copyOrderId $copyOrderId;
  460.         return $this;
  461.     }
  462.     /**
  463.      * @return Collection<int, OrderProduct>
  464.      */
  465.     public function getOrderProducts(): Collection
  466.     {
  467.         return $this->orderProducts;
  468.     }
  469.     public function addOrderProduct(OrderProduct $orderProduct): self
  470.     {
  471.         if (!$this->orderProducts->contains($orderProduct)) {
  472.             $this->orderProducts->add($orderProduct);
  473.             $orderProduct->setOrder($this);
  474.         }
  475.         return $this;
  476.     }
  477.     public function removeOrderProduct(OrderProduct $orderProduct): self
  478.     {
  479.         if ($this->orderProducts->removeElement($orderProduct)) {
  480.             // set the owning side to null (unless already changed)
  481.             if ($orderProduct->getOrder() === $this) {
  482.                 $orderProduct->setOrder(null);
  483.             }
  484.         }
  485.         return $this;
  486.     }
  487.     public function getStorage(): ?Storage
  488.     {
  489.         return $this->storage;
  490.     }
  491.     public function setStorage(?Storage $storage): self
  492.     {
  493.         $this->storage $storage;
  494.         return $this;
  495.     }
  496.     public function getShippingMethod(): ?string
  497.     {
  498.         return $this->shippingMethod;
  499.     }
  500.     public function setShippingMethod(?string $shippingMethod): self
  501.     {
  502.         $this->shippingMethod $shippingMethod;
  503.         return $this;
  504.     }
  505.     public function getDovirenistSeries(): ?string
  506.     {
  507.         return $this->dovirenistSeries;
  508.     }
  509.     public function setDovirenistSeries(?string $dovirenistSeries): self
  510.     {
  511.         $this->dovirenistSeries $dovirenistSeries;
  512.         return $this;
  513.     }
  514.     public function getDovirenistNumber(): ?string
  515.     {
  516.         return $this->dovirenistNumber;
  517.     }
  518.     public function setDovirenistNumber(?string $dovirenistNumber): self
  519.     {
  520.         $this->dovirenistNumber $dovirenistNumber;
  521.         return $this;
  522.     }
  523.     public function isIsGot(): ?bool
  524.     {
  525.         return $this->isGot;
  526.     }
  527.     public function setIsGot(?bool $isGot): self
  528.     {
  529.         $this->isGot $isGot;
  530.         return $this;
  531.     }
  532.     public function getDovirenistDate(): ?\DateTimeInterface
  533.     {
  534.         return $this->dovirenistDate;
  535.     }
  536.     public function setDovirenistDate(?\DateTimeInterface $dovirenistDate): self
  537.     {
  538.         $this->dovirenistDate $dovirenistDate;
  539.         return $this;
  540.     }
  541.     public function getReleaseAllowed(): ?User
  542.     {
  543.         return $this->releaseAllowed;
  544.     }
  545.     public function setReleaseAllowed(?User $releaseAllowed): self
  546.     {
  547.         $this->releaseAllowed $releaseAllowed;
  548.         return $this;
  549.     }
  550.     public function isIsReleaseAllowed(): ?bool
  551.     {
  552.         return $this->isReleaseAllowed;
  553.     }
  554.     public function setIsReleaseAllowed(?bool $isReleaseAllowed): self
  555.     {
  556.         $this->isReleaseAllowed $isReleaseAllowed;
  557.         return $this;
  558.     }
  559.     public function getIsChecked(): ?bool
  560.     {
  561.         return $this->isChecked;
  562.     }
  563.     public function setIsChecked(?bool $isChecked): self
  564.     {
  565.         $this->isChecked $isChecked;
  566.         return $this;
  567.     }
  568.     public function getChecked(): ?User
  569.     {
  570.         return $this->checked;
  571.     }
  572.     public function setChecked(?User $checked): self
  573.     {
  574.         $this->checked $checked;
  575.         return $this;
  576.     }
  577.     public function getCarrier(): ?string
  578.     {
  579.         return $this->carrier;
  580.     }
  581.     public function setCarrier(?string $carrier): self
  582.     {
  583.         $this->carrier $carrier;
  584.         return $this;
  585.     }
  586.     public function getId1c(): ?string
  587.     {
  588.         return $this->id_1c;
  589.     }
  590.     public function setId1c(?string $id_1c): self
  591.     {
  592.         $this->id_1c $id_1c;
  593.         return $this;
  594.     }
  595.     public function getSumTransport(): ?float
  596.     {
  597.         return $this->sumTransport;
  598.     }
  599.     public function setSumTransport(?float $sumTransport): self
  600.     {
  601.         $this->sumTransport $sumTransport;
  602.         return $this;
  603.     }
  604.     public function getPreOrder(): ?PreOrder
  605.     {
  606.         return $this->preOrder;
  607.     }
  608.     public function setPreOrder(?PreOrder $preOrder): self
  609.     {
  610.         $this->preOrder $preOrder;
  611.         return $this;
  612.     }
  613.     // public function getLoadInvoice(): ?LoadInvoice
  614.     // {
  615.     //     return $this->load_invoice;
  616.     // }
  617.     // public function setLoadInvoice(?LoadInvoice $load_invoice): self
  618.     // {
  619.     //     $this->load_invoice = $load_invoice;
  620.     //     return $this;
  621.     // }
  622.     /**
  623.      * @return Collection<int, LoadInvoice>
  624.      */
  625.     // public function getLoadInvoices(): Collection
  626.     // {
  627.     //     return $this->loadInvoices;
  628.     // }
  629.     // public function addLoadInvoice(LoadInvoice $loadInvoice): self
  630.     // {
  631.     //     if (!$this->loadInvoices->contains($loadInvoice)) {
  632.     //         $this->loadInvoices->add($loadInvoice);
  633.     //         $loadInvoice->setOrder($this);
  634.     //     }
  635.     //     return $this;
  636.     // }
  637.     // public function removeLoadInvoice(LoadInvoice $loadInvoice): self
  638.     // {
  639.     //     if ($this->loadInvoices->removeElement($loadInvoice)) {
  640.     //         // set the owning side to null (unless already changed)
  641.     //         if ($loadInvoice->getOrder() === $this) {
  642.     //             $loadInvoice->setOrder(null);
  643.     //         }
  644.     //     }
  645.     //     return $this;
  646.     // }
  647.     /**
  648.      * @return Collection<int, Accepted>
  649.      */
  650.     public function getAccepteds(): Collection
  651.     {
  652.         return $this->accepteds;
  653.     }
  654.     public function addAccepted(Accepted $accepted): self
  655.     {
  656.         if (!$this->accepteds->contains($accepted)) {
  657.             $this->accepteds->add($accepted);
  658.             $accepted->setOrder($this);
  659.         }
  660.         return $this;
  661.     }
  662.     public function removeAccepted(Accepted $accepted): self
  663.     {
  664.         if ($this->accepteds->removeElement($accepted)) {
  665.             // set the owning side to null (unless already changed)
  666.             if ($accepted->getOrder() === $this) {
  667.                 $accepted->setOrder(null);
  668.             }
  669.         }
  670.         return $this;
  671.     }
  672.     /**
  673.      * @return Collection<int, LoadInvoice>
  674.      */
  675.     public function getLoadInvoice(): Collection
  676.     {
  677.         return $this->loadInvoice;
  678.     }
  679.     public function addLoadInvoice(LoadInvoice $loadInvoice): self
  680.     {
  681.         if (!$this->loadInvoice->contains($loadInvoice)) {
  682.             $this->loadInvoice->add($loadInvoice);
  683.         }
  684.         return $this;
  685.     }
  686.     public function removeLoadInvoice(LoadInvoice $loadInvoice): self
  687.     {
  688.         $this->loadInvoice->removeElement($loadInvoice);
  689.         return $this;
  690.     }
  691.     /**
  692.      * @return Collection<int, Calculations>
  693.      */
  694.     public function getCalculations(): Collection
  695.     {
  696.         return $this->calculations;
  697.     }
  698.     public function addCalculation(Calculations $calculation): self
  699.     {
  700.         if (!$this->calculations->contains($calculation)) {
  701.             $this->calculations->add($calculation);
  702.             $calculation->setOrders($this);
  703.         }
  704.         return $this;
  705.     }
  706.     public function removeCalculation(Calculations $calculation): self
  707.     {
  708.         if ($this->calculations->removeElement($calculation)) {
  709.             // set the owning side to null (unless already changed)
  710.             if ($calculation->getOrders() === $this) {
  711.                 $calculation->setOrders(null);
  712.             }
  713.         }
  714.         return $this;
  715.     }
  716.     /**
  717.      * @return Collection<int, MediaObject>
  718.      */
  719.     public function getMediaObjects(): Collection
  720.     {
  721.         return $this->mediaObjects;
  722.     }
  723.     public function addMediaObject(MediaObject $mediaObject): self
  724.     {
  725.         if (!$this->mediaObjects->contains($mediaObject)) {
  726.             $this->mediaObjects->add($mediaObject);
  727.             $mediaObject->setOrders($this);
  728.         }
  729.         return $this;
  730.     }
  731.     public function removeMediaObject(MediaObject $mediaObject): self
  732.     {
  733.         if ($this->mediaObjects->removeElement($mediaObject)) {
  734.             // set the owning side to null (unless already changed)
  735.             if ($mediaObject->getOrders() === $this) {
  736.                 $mediaObject->setOrders(null);
  737.             }
  738.         }
  739.         return $this;
  740.     }
  741.     #[ORM\PrePersist]
  742.     public function setCreatedAtValue(): void
  743.     {
  744.         $this->dateEntered = new \DateTime();
  745.     }
  746.     // #[ORM\PrePersist]
  747.     #[ORM\PreUpdate]
  748.     public function setUpdatedAtValue(): void
  749.     {
  750.         $this->dateModified = new \DateTime();
  751.     }
  752.     public function isSynced(): ?bool
  753.     {
  754.         return $this->synced;
  755.     }
  756.     public function setSynced(?bool $synced): self
  757.     {
  758.         $this->synced $synced;
  759.         return $this;
  760.     }
  761.     public function getAgreement(): ?Agreements
  762.     {
  763.         return $this->agreement;
  764.     }
  765.     public function setAgreement(?Agreements $agreement): self
  766.     {
  767.         $this->agreement $agreement;
  768.         return $this;
  769.     }
  770.     public function getCreatedIn(): ?string
  771.     {
  772.         return $this->createdIn;
  773.     }
  774.     public function setCreatedIn(?string $createdIn): self
  775.     {
  776.         $this->createdIn $createdIn;
  777.         return $this;
  778.     }
  779.     public function getParent(): ?self
  780.     {
  781.         return $this->parent;
  782.     }
  783.     public function setParent(?self $parent): self
  784.     {
  785.         $this->parent $parent;
  786.         return $this;
  787.     }
  788.     /**
  789.      * @return Collection<int, self>
  790.      */
  791.     public function getParentOrders(): Collection
  792.     {
  793.         return $this->parentOrders;
  794.     }
  795.     public function addParentOrder(self $parentOrder): self
  796.     {
  797.         if (!$this->parentOrders->contains($parentOrder)) {
  798.             $this->parentOrders->add($parentOrder);
  799.             $parentOrder->setParent($this);
  800.         }
  801.         return $this;
  802.     }
  803.     public function removeParentOrder(self $parentOrder): self
  804.     {
  805.         if ($this->parentOrders->removeElement($parentOrder)) {
  806.             // set the owning side to null (unless already changed)
  807.             if ($parentOrder->getParent() === $this) {
  808.                 $parentOrder->setParent(null);
  809.             }
  810.         }
  811.         return $this;
  812.     }
  813.     public function getAddress(): ?AccountAddress
  814.     {
  815.         return $this->address;
  816.     }
  817.     public function setAddress(?AccountAddress $address): self
  818.     {
  819.         $this->address $address;
  820.         return $this;
  821.     }
  822.     public function isDeleted(): ?bool
  823.     {
  824.         return $this->deleted;
  825.     }
  826.     public function setDeleted(?bool $deleted): static
  827.     {
  828.         $this->deleted $deleted;
  829.         return $this;
  830.     }
  831. }