src/Entity/Order.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\OrderEnum;
  4. use App\Enum\PaymentEnum;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use JMS\Serializer\Annotation as Serializer;
  9. /**
  10. * @ORM\Entity(repositoryClass="App\Repository\OrderRepository")
  11. * @ORM\Table(name="`order`")
  12. * @ORM\EntityListeners({
  13. * "App\Listener\EntityListener",
  14. * "App\Listener\OrderListener"
  15. * })
  16. */
  17. class Order
  18. {
  19. /**
  20. * @ORM\Id()
  21. * @ORM\GeneratedValue()
  22. * @ORM\Column(type="integer")
  23. */
  24. private $id;
  25. /**
  26. * @ORM\Column(type="integer")
  27. */
  28. private $number;
  29. /**
  30. * @ORM\Column(type="string")
  31. */
  32. private $hash;
  33. /**
  34. * @ORM\Column(type="datetime")
  35. */
  36. private $createts;
  37. /**
  38. * @ORM\Column(type="datetime", nullable=true)
  39. */
  40. private $editts;
  41. /**
  42. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  43. */
  44. private $editUser;
  45. /**
  46. * @ORM\ManyToOne(targetEntity="App\Entity\Client",cascade={"persist"}, inversedBy="orders")
  47. * @ORM\JoinColumn(nullable=true)
  48. */
  49. private $client;
  50. /**
  51. * @ORM\OneToOne(targetEntity=OrderAddress::class, cascade={"persist"})
  52. */
  53. private $billingAddress;
  54. /**
  55. * @ORM\OneToOne(targetEntity=OrderAddress::class, cascade={"persist"})
  56. */
  57. private $deliveryAddress;
  58. /**
  59. * @ORM\ManyToOne(targetEntity="App\Entity\Payment")
  60. * @ORM\JoinColumn(nullable=false)
  61. */
  62. private $payment;
  63. /**
  64. * @ORM\ManyToOne(targetEntity="App\Entity\Transport")
  65. * @ORM\JoinColumn(nullable=false)
  66. */
  67. private $transport;
  68. /**
  69. * @ORM\Column(type="string", length=3)
  70. */
  71. private $currency;
  72. /**
  73. * @ORM\Column(type="string", length=2)
  74. */
  75. private $locale;
  76. /**
  77. * @ORM\Column(type="float")
  78. */
  79. private $priceSum;
  80. /**
  81. * @ORM\Column(type="float")
  82. */
  83. private $priceSumNoTax;
  84. /**
  85. * @ORM\Column(type="float")
  86. */
  87. private $pricePayment;
  88. /**
  89. * @ORM\Column(type="float")
  90. */
  91. private $priceTransport;
  92. /**
  93. * @ORM\Column(type="text", nullable=true)
  94. */
  95. private $note;
  96. /**
  97. * @ORM\Column(type="text", nullable=true)
  98. */
  99. private $stornoNote;
  100. /**
  101. * @ORM\Column(type="integer", length=2)
  102. */
  103. private $status;
  104. /**
  105. * @ORM\OneToMany(targetEntity="App\Entity\OrderItem",cascade={"all"}, mappedBy="order", orphanRemoval=true)
  106. */
  107. private $orderItems;
  108. /**
  109. * @ORM\ManyToOne(targetEntity="App\Entity\Dealer", inversedBy="orders")
  110. * @ORM\JoinColumn(nullable=false)
  111. */
  112. private $dealer;
  113. /**
  114. * @ORM\Column(type="integer", nullable=true)
  115. */
  116. private $onlineCounter = 0;
  117. /**
  118. * @ORM\Column(type="boolean")
  119. */
  120. private $paid = false;
  121. /**
  122. * @ORM\Column(type="datetime", nullable=true)
  123. */
  124. private $paidts;
  125. /**
  126. * @ORM\Column(type="datetime", nullable=true)
  127. */
  128. private $sentts;
  129. /**
  130. * čas přijetí do ticu
  131. * @ORM\Column(type="datetime", nullable=true)
  132. */
  133. private $ticts;
  134. /**
  135. * @ORM\Column(type="boolean")
  136. */
  137. private $needSendEmail = false;
  138. /**
  139. * @ORM\Column(type="datetime", nullable=true)
  140. */
  141. private $sendedEmailts;
  142. /**
  143. * @ORM\Column(type="datetime", nullable=true)
  144. */
  145. private $exportts;
  146. /**
  147. * @ORM\ManyToOne(targetEntity="App\Entity\Domain")
  148. * @ORM\JoinColumn(nullable=true)
  149. */
  150. private $domain;
  151. /**
  152. * @ORM\Column(type="datetime", nullable=true)
  153. */
  154. private $stornots;
  155. /**
  156. * @ORM\OneToMany(targetEntity=OrderLog::class,cascade={"all"}, mappedBy="order", orphanRemoval=true)
  157. * @ORM\OrderBy({ "createts" = "DESC"})
  158. */
  159. private $logs;
  160. /**
  161. * @ORM\OneToMany(targetEntity=Reclamation::class, mappedBy="order", orphanRemoval=true)
  162. */
  163. private $reclamations;
  164. private $linkGateway;
  165. /**
  166. * @Serializer\Groups({"excalibur"})
  167. * @Serializer\VirtualProperty
  168. * @Serializer\Inline
  169. */
  170. public function excalibur(){
  171. $polozky = [];
  172. foreach ($this->getOrderItems() as $orderItem) {
  173. $polozky[]=[
  174. 'CenaSDPH' => $orderItem->getPrice(),
  175. 'Nazev'=> $orderItem->getName(),
  176. 'IDKarty'=> $orderItem->getVariant()->getCode(),
  177. 'Mnozstvi'=> $orderItem->getCount(),
  178. 'SazbaDPH'=> $orderItem->getTax(),
  179. 'Typ'=> 'item'
  180. ];
  181. }
  182. return [
  183. 'IdObjednavky' => $this->getNumber(),
  184. 'Stav' => 0,
  185. 'Prijato' => $this->getCreatets()->format('Y-m-d H:i:s'),
  186. 'Mena' => $this->getCurrency(),
  187. 'Cislo' => $this->getNumber(),
  188. 'FakCisloZak' => '',
  189. 'FakJmeno' => $this->getBillingAddress()->getFullName(),
  190. 'FakEmail' => $this->getBillingAddress()->getEmail(),
  191. 'FakTelefon' => $this->getBillingAddress()->getPhone(),
  192. 'FakUlice' => $this->getBillingAddress()->getStreet(),
  193. 'FakCisloOrient' => $this->getBillingAddress()->getStreetNumber(),
  194. 'FakCisloPopis' => '',
  195. 'FakMisto' => $this->getBillingAddress()->getCity(),
  196. 'FakPSC' => $this->getBillingAddress()->getZip(),
  197. 'FakStat' => strtoupper($this->getBillingAddress()->getCountry()),
  198. 'DodCisloZak' => '',
  199. 'DodJmeno' => $this->getDeliveryAddress() !== null?$this->getDeliveryAddress()->getFullName():'',
  200. 'DodEmail' => $this->getDeliveryAddress() !== null?$this->getDeliveryAddress()->getEmail():'',
  201. 'DodTelefon' => $this->getDeliveryAddress() !== null?$this->getDeliveryAddress()->getPhone():'',
  202. 'DodUlice' => $this->getDeliveryAddress() !== null?$this->getDeliveryAddress()->getStreet():'',
  203. 'DodCisloOrient' => $this->getDeliveryAddress() !== null?$this->getDeliveryAddress()->getStreetNumber():'',
  204. 'DodCisloPopis' => '',
  205. 'DodMisto' => $this->getDeliveryAddress() !== null?$this->getDeliveryAddress()->getCity():'',
  206. 'DodPSC' => $this->getDeliveryAddress() !== null?$this->getDeliveryAddress()->getZip():'',
  207. 'DodStat' => $this->getDeliveryAddress() !== null?strtoupper($this->getDeliveryAddress()->getCountry()):'',
  208. 'DodExternalID' => '',
  209. 'Poznamka' => $this->getNote(),
  210. 'DatumDodani' => '',
  211. 'CisloFaktury' => '',
  212. 'Paid' => $this->getPaid(),
  213. 'Polozky'=>$polozky,
  214. 'Doprava'=> [
  215. 'ZpDopravy' => $this->getTransport()->getCode(),
  216. 'Mnozstvi' => 1,
  217. 'Nazev' => $this->getTransport()->getName(),
  218. 'CenaSDPH' => 0,
  219. 'SazbaDPH' => 21
  220. ],
  221. 'Platba'=> [
  222. 'TypPlatby' => $this->getPayment()->getCode(),
  223. 'Mnozstvi' => 1,
  224. 'Nazev' => $this->getPayment()->getName(),
  225. 'CenaSDPH' => 0,
  226. 'SazbaDPH' => 21
  227. ]
  228. ];
  229. }
  230. public function __construct(Domain $domain, $currency)
  231. {
  232. $this->setDomain($domain);
  233. $this->setLocale($domain->getLocale());
  234. $this->setCurrency($currency);
  235. $this->orderItems = new ArrayCollection();
  236. $this->logs = new ArrayCollection();
  237. $this->reclamations = new ArrayCollection();
  238. }
  239. public function getFormatDeliveryAddress( )
  240. {
  241. if($this->getDeliveryAddress() instanceof OrderAddress){
  242. return $this->formatAddress($this->getDeliveryAddress());
  243. }
  244. return $this->formatAddress($this->getBillingAddress());
  245. }
  246. /**
  247. * mustPaidBeforeSend - Vrátí bool zda je potřeba platba předem
  248. *
  249. * @return bool
  250. */
  251. public function mustPaidBeforeSend( ): bool
  252. {
  253. return PaymentEnum::mustPaidBeforeSend($this->getPayment()->getType());
  254. }
  255. private function formatAddress( OrderAddress $address )
  256. {
  257. $out = (empty($address->getLastName())?$this->getFullName():$address->getFullName()).'<br>';
  258. if($address->getisCompany() && !empty($address->getCompanyName())){
  259. $out.= $address->getCompanyName().'<br>';
  260. }
  261. $out .= $address->getStreet().' '.$address->getStreetNumber().'<br>';
  262. $out .= $address->getCity().'<br>';
  263. $out .= $address->getZip().'<br>';
  264. $out .= $address->getCountry().'<br>';
  265. $out .= $address->getPhone();
  266. if(!empty($address->getNote())){
  267. $out.='<br><br>'.$address->getNote();
  268. }
  269. return $out;
  270. }
  271. /**
  272. * initCart - Vytvoření objednávky z košíku po odeslání kroku 3
  273. *
  274. * @param Cart $cart
  275. *
  276. * @return $this
  277. */
  278. public function initCart( Cart $cart)
  279. {
  280. $this->setClient($cart->getClient());
  281. $this->setTransport($cart->getTransport());
  282. $this->setPayment($cart->getPayment());
  283. //$this->setLocale(\Locale::getDefault());
  284. $this->setPriceTransport($cart->getTransportPrice());
  285. $this->setPricePayment($cart->getPaymentPrice());
  286. $this->setNote($cart->getNote());
  287. $this->setDealer($cart->getDealer());
  288. $this->setBillingAddress($cart->getBillingAddress()->convertToOrder());
  289. if($cart->getHasDeliveryAddress()) {
  290. $this->setDeliveryAddress( $cart->getDeliveryAddress()->convertToOrder() );
  291. }
  292. foreach ($cart->getCartItems() as $cartItem){
  293. $item = new OrderItem();
  294. $item->setCount($cartItem->getCount());
  295. $item->setProduct($cartItem->getProduct());
  296. $item->setVariant($cartItem->getVariant());
  297. $item->setName(sprintf('%s - %s',$cartItem->getProduct()->getName(),$cartItem->getVariant()->getName()));
  298. $item->setDealer($cartItem->getProduct()->getDealer());
  299. $item->setCourse($cartItem->getProduct()->getDealer()->getCourse());
  300. $pricelist = $cartItem->getProduct()->getPrice($this->getCurrency());
  301. $item->setPrice($pricelist->getPrice());
  302. $item->setTax($pricelist->getTax());
  303. $item->setCurrency($this->getCurrency());
  304. $this->addOrderItem($item);
  305. }
  306. if($this->mustPaidBeforeSend()){
  307. $this->setStatus(OrderEnum::IN_PAYMENT);
  308. }else if($this->getTransport()->getisPersonal()){
  309. $this->setStatus(OrderEnum::TO_PICK);
  310. }else {
  311. $this->setStatus(OrderEnum::TO_SEND);
  312. }
  313. return $this;
  314. }
  315. public function setDefaultLocale( $locale )
  316. {
  317. foreach ( $this->getOrderItems() as $orderItem ) {
  318. $orderItem->getProduct()->setDefaultLocale($locale);
  319. }
  320. $this->getTransport()->setDefaultLocale($locale);
  321. $this->getPayment()->setDefaultLocale($locale);
  322. }
  323. public function getId(): ?int
  324. {
  325. return $this->id;
  326. }
  327. public function getNumber(): ?int
  328. {
  329. return $this->number;
  330. }
  331. public function setNumber(int $number): self
  332. {
  333. $this->number = $number;
  334. return $this;
  335. }
  336. public function getCreatets(): ?\DateTimeInterface
  337. {
  338. return $this->createts;
  339. }
  340. public function setCreatets(\DateTimeInterface $createts): self
  341. {
  342. $this->createts = $createts;
  343. return $this;
  344. }
  345. public function getEditts(): ?\DateTimeInterface
  346. {
  347. return $this->editts;
  348. }
  349. public function setEditts(?\DateTimeInterface $editts): self
  350. {
  351. $this->editts = $editts;
  352. return $this;
  353. }
  354. public function getEditUser(): ?User
  355. {
  356. return $this->editUser;
  357. }
  358. public function setEditUser(?User $editUser): self
  359. {
  360. $this->editUser = $editUser;
  361. return $this;
  362. }
  363. public function getClient(): ?Client
  364. {
  365. return $this->client;
  366. }
  367. public function setClient(?Client $client): self
  368. {
  369. $this->client = $client;
  370. return $this;
  371. }
  372. public function initClient(?Client $client): self
  373. {
  374. if($client instanceof Client) {
  375. $this->setClient( $client );
  376. /*$this->setClientFirstName( $client->getFirstName() );
  377. $this->setClientLastName( $client->getLastName() );
  378. $this->setClientEmail( $client->getEmail() );*/
  379. if($client->getBillingAddress() instanceof ClientAddress){
  380. $billing = $client->getBillingAddress();
  381. }else{
  382. $billing = $client->getClientAddresses()->first();
  383. }
  384. $billingAddress = new OrderAddress();
  385. $billingAddress->init( $billing );
  386. $this->setBillingAddress($billingAddress);
  387. if($client->getDeliveryAddress() instanceof ClientAddress){
  388. $delivery = $client->getDeliveryAddress();
  389. }else{
  390. $delivery = $billing;
  391. }
  392. $deliveryAddress = new OrderAddress();
  393. $deliveryAddress->init( $delivery );
  394. $this->setDeliveryAddress($deliveryAddress);
  395. }
  396. return $this;
  397. }
  398. public function getPayment(): Payment
  399. {
  400. return $this->payment;
  401. }
  402. public function setPayment(?Payment $payment): self
  403. {
  404. $this->payment = $payment;
  405. return $this;
  406. }
  407. public function getTransport():Transport
  408. {
  409. return $this->transport;
  410. }
  411. public function setTransport(?Transport $transport): self
  412. {
  413. $this->transport = $transport;
  414. return $this;
  415. }
  416. public function getCurrency(): ?string
  417. {
  418. return $this->currency;
  419. }
  420. public function setCurrency(string $currency): self
  421. {
  422. $this->currency = $currency;
  423. return $this;
  424. }
  425. public function getPriceSum(): ?float
  426. {
  427. return $this->priceSum;
  428. }
  429. public function setPriceSum(float $priceSum): self
  430. {
  431. $this->priceSum = $priceSum;
  432. return $this;
  433. }
  434. public function getPriceSumNoTax(): ?float
  435. {
  436. return $this->priceSumNoTax;
  437. }
  438. public function setPriceSumNoTax(float $priceSumNoTax): self
  439. {
  440. $this->priceSumNoTax = $priceSumNoTax;
  441. return $this;
  442. }
  443. public function getPricePayment(): ?float
  444. {
  445. return $this->pricePayment;
  446. }
  447. public function setPricePayment(float $pricePayment): self
  448. {
  449. $this->pricePayment = $pricePayment;
  450. return $this;
  451. }
  452. public function getPriceTransport(): ?float
  453. {
  454. return $this->priceTransport;
  455. }
  456. public function setPriceTransport(float $priceTransport): self
  457. {
  458. $this->priceTransport = $priceTransport;
  459. return $this;
  460. }
  461. public function getStatus(): ?int
  462. {
  463. return $this->status;
  464. }
  465. public function setStatus(int $status): self
  466. {
  467. $this->status = $status;
  468. return $this;
  469. }
  470. /**
  471. * @return Collection|OrderItem[]
  472. */
  473. public function getOrderItems(): Collection
  474. {
  475. return $this->orderItems;
  476. }
  477. public function addOrderItem(OrderItem $orderItem): self
  478. {
  479. if (!$this->orderItems->contains($orderItem)) {
  480. $this->orderItems[] = $orderItem;
  481. $orderItem->setOrder($this);
  482. }
  483. return $this;
  484. }
  485. public function removeOrderItem(OrderItem $orderItem): self
  486. {
  487. if ($this->orderItems->contains($orderItem)) {
  488. $this->orderItems->removeElement($orderItem);
  489. // set the owning side to null (unless already changed)
  490. if ($orderItem->getOrder() === $this) {
  491. $orderItem->setOrder(null);
  492. }
  493. }
  494. return $this;
  495. }
  496. public function getCountOrderItems(): int
  497. {
  498. $sum = 0;
  499. foreach ( $this->getOrderItems() as $orderItem ) {
  500. $sum += $orderItem->getCount();
  501. }
  502. return $sum;
  503. }
  504. /**
  505. * Get Note
  506. *
  507. * @return mixed
  508. */
  509. public function getNote()
  510. {
  511. return $this->note;
  512. }
  513. /**
  514. * Set Note
  515. *
  516. * @param mixed $note
  517. */
  518. public function setNote( $note )
  519. {
  520. $this->note = $note;
  521. }
  522. /**
  523. * Get Paid
  524. *
  525. * @return mixed
  526. */
  527. public function getPaid()
  528. {
  529. return $this->paid;
  530. }
  531. /**
  532. * Set Paid
  533. *
  534. * @param mixed $paid
  535. */
  536. public function setPaid( $paid )
  537. {
  538. $this->paid = $paid;
  539. }
  540. /**
  541. * Get Paidts
  542. *
  543. * @return mixed
  544. */
  545. public function getPaidts()
  546. {
  547. return $this->paidts;
  548. }
  549. /**
  550. * Set Paidts
  551. *
  552. * @param mixed $paidts
  553. */
  554. public function setPaidts( $paidts )
  555. {
  556. $this->paidts = $paidts;
  557. }
  558. /**
  559. * Get Sentts
  560. *
  561. * @return mixed
  562. */
  563. public function getSentts()
  564. {
  565. return $this->sentts;
  566. }
  567. /**
  568. * Set Sentts
  569. *
  570. * @param mixed $sentts
  571. */
  572. public function setSentts( $sentts )
  573. {
  574. $this->sentts = $sentts;
  575. }
  576. /**
  577. * Get BillingAddress
  578. *
  579. * @return mixed
  580. */
  581. public function getBillingAddress(): ?OrderAddress
  582. {
  583. return $this->billingAddress;
  584. }
  585. /**
  586. * Set BillingAddress
  587. *
  588. * @param mixed $billingAddress
  589. */
  590. public function setBillingAddress( $billingAddress )
  591. {
  592. $this->billingAddress = $billingAddress;
  593. }
  594. /**
  595. * Get DeliveryAddress
  596. *
  597. * @return mixed
  598. */
  599. public function getDeliveryAddress()
  600. {
  601. return $this->deliveryAddress;
  602. }
  603. /**
  604. * Set DeliveryAddress
  605. *
  606. * @param mixed $deliveryAddress
  607. */
  608. public function setDeliveryAddress( $deliveryAddress )
  609. {
  610. $this->deliveryAddress = $deliveryAddress;
  611. }
  612. /**
  613. * Get Domain
  614. *
  615. * @return mixed
  616. */
  617. public function getDomain()
  618. {
  619. return $this->domain;
  620. }
  621. /**
  622. * Set Domain
  623. *
  624. * @param mixed $domain
  625. */
  626. public function setDomain( $domain )
  627. {
  628. $this->domain = $domain;
  629. }
  630. /**
  631. * Get NeedSendEmail
  632. *
  633. * @return mixed
  634. */
  635. public function getNeedSendEmail()
  636. {
  637. return $this->needSendEmail;
  638. }
  639. /**
  640. * Set NeedSendEmail
  641. *
  642. * @param mixed $needSendEmail
  643. */
  644. public function setNeedSendEmail( $needSendEmail )
  645. {
  646. $this->needSendEmail = $needSendEmail;
  647. }
  648. /**
  649. * Get SendedEmailts
  650. *
  651. * @return mixed
  652. */
  653. public function getSendedEmailts()
  654. {
  655. return $this->sendedEmailts;
  656. }
  657. /**
  658. * Set SendedEmailts
  659. *
  660. * @param mixed $sendedEmailts
  661. */
  662. public function setSendedEmailts( $sendedEmailts )
  663. {
  664. $this->sendedEmailts = $sendedEmailts;
  665. }
  666. /**
  667. * Get Locale
  668. *
  669. * @return mixed
  670. */
  671. public function getLocale()
  672. {
  673. return $this->locale;
  674. }
  675. /**
  676. * Set Locale
  677. *
  678. * @param mixed $locale
  679. */
  680. public function setLocale( $locale )
  681. {
  682. $this->locale = $locale;
  683. }
  684. /**
  685. * Get Stornots
  686. *
  687. * @return mixed
  688. */
  689. public function getStornots()
  690. {
  691. return $this->stornots;
  692. }
  693. /**
  694. * Set Stornots
  695. *
  696. * @param mixed $stornots
  697. */
  698. public function setStornots( $stornots )
  699. {
  700. $this->stornots = $stornots;
  701. }
  702. /**
  703. * Get Dealer
  704. *
  705. * @return mixed
  706. */
  707. public function getDealer(): Dealer
  708. {
  709. return $this->dealer;
  710. }
  711. /**
  712. * Set Dealer
  713. *
  714. * @param mixed $dealer
  715. */
  716. public function setDealer( $dealer )
  717. {
  718. $this->dealer = $dealer;
  719. }
  720. /**
  721. * @return Collection|OrderLog[]
  722. */
  723. public function getLogs(): Collection
  724. {
  725. return $this->logs;
  726. }
  727. public function addLog(OrderLog $log): self
  728. {
  729. if (!$this->logs->contains($log)) {
  730. $this->logs[] = $log;
  731. $log->setOrder2($this);
  732. }
  733. return $this;
  734. }
  735. public function removeLog(OrderLog $log): self
  736. {
  737. if ($this->logs->removeElement($log)) {
  738. // set the owning side to null (unless already changed)
  739. if ($log->getOrder2() === $this) {
  740. $log->setOrder2(null);
  741. }
  742. }
  743. return $this;
  744. }
  745. /**
  746. * Get Exportts
  747. *
  748. * @return mixed
  749. */
  750. public function getExportts()
  751. {
  752. return $this->exportts;
  753. }
  754. /**
  755. * Set Exportts
  756. *
  757. * @param mixed $exportts
  758. */
  759. public function setExportts( $exportts )
  760. {
  761. $this->exportts = $exportts;
  762. }
  763. /**
  764. * Get OnlineCounter
  765. *
  766. * @return mixed
  767. */
  768. public function getOnlineCounter()
  769. {
  770. return $this->onlineCounter;
  771. }
  772. /**
  773. * Set OnlineCounter
  774. *
  775. * @param mixed $onlineCounter
  776. */
  777. public function setOnlineCounter( $onlineCounter )
  778. {
  779. $this->onlineCounter = $onlineCounter;
  780. }
  781. /**
  782. * @return mixed
  783. */
  784. public function getTicts()
  785. {
  786. return $this->ticts;
  787. }
  788. /**
  789. * @param mixed $ticts
  790. */
  791. public function setTicts($ticts): void
  792. {
  793. $this->ticts = $ticts;
  794. }
  795. /**
  796. * @return Collection|Reclamation[]
  797. */
  798. public function getReclamations(): Collection
  799. {
  800. return $this->reclamations;
  801. }
  802. public function addReclamation(Reclamation $reclamation): self
  803. {
  804. if (!$this->reclamations->contains($reclamation)) {
  805. $this->reclamations[] = $reclamation;
  806. $reclamation->setOrder($this);
  807. }
  808. return $this;
  809. }
  810. public function removeReclamation(Reclamation $reclamation): self
  811. {
  812. if ($this->reclamations->removeElement($reclamation)) {
  813. // set the owning side to null (unless already changed)
  814. if ($reclamation->getOrder() === $this) {
  815. $reclamation->setOrder(null);
  816. }
  817. }
  818. return $this;
  819. }/*
  820. public function createHash( )
  821. {
  822. return base64_encode(sprintf('%s|%s|%s',$this->getBillingAddress()->getEmail(),$this->getNumber(),$this->getId()));
  823. }*/
  824. /**
  825. * @return mixed
  826. */
  827. public function getHash()
  828. {
  829. return $this->hash;
  830. }
  831. /**
  832. * @param mixed $hash
  833. */
  834. public function setHash($hash): void
  835. {
  836. $this->hash = $hash;
  837. }
  838. /**
  839. * @return mixed
  840. */
  841. public function getLinkGateway()
  842. {
  843. return $this->linkGateway;
  844. }
  845. /**
  846. * @param mixed $linkGateway
  847. */
  848. public function setLinkGateway($linkGateway): void
  849. {
  850. $this->linkGateway = $linkGateway;
  851. }
  852. /**
  853. * @return mixed
  854. */
  855. public function getStornoNote()
  856. {
  857. return $this->stornoNote;
  858. }
  859. /**
  860. * @param mixed $stornoNote
  861. */
  862. public function setStornoNote($stornoNote): void
  863. {
  864. $this->stornoNote = $stornoNote;
  865. }
  866. }