src/Entity/System/Carrier.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table(name="ps_carrier", indexes={
  6. *
  7. * @ORM\Index(name="deleted", columns={"deleted", "active"}),
  8. * @ORM\Index(name="id_tax_rules_group", columns={"id_tax_rules_group"}),
  9. * @ORM\Index(name="shipping_method", columns={"shipping_method"}),
  10. * @ORM\Index(name="id_carrier_master", columns={"id_carrier_master"})
  11. * })
  12. *
  13. * @ORM\Entity(repositoryClass="App\Repository\System\CarrierRepository")
  14. */
  15. class Carrier
  16. {
  17. public const PARCEL_POD = 1;
  18. public const PALLET_POD = 2;
  19. public const PARCEL_NO_POD = 3;
  20. public const PACKAGING_METHODS = [
  21. self::PARCEL_POD,
  22. self::PALLET_POD,
  23. self::PARCEL_NO_POD,
  24. ];
  25. public const REAL_WEIGHT_SHIPPING_METHOD_ID = 1;
  26. public const MAX_BETWEEN_REAL_AND_VOLUMETRIC_WEIGHT_SHIPPING_METHOD_ID = 2;
  27. public const CHRONO_ID = 43;
  28. public const CORREOS_ID = 45;
  29. public const GLS_ID = 48;
  30. public const SERVICES_ID = 53;
  31. public const SEUR_ID = 54;
  32. public const WAREHOUSE_PICKUP_ID = 55;
  33. public const TNT_ID = 56;
  34. public const CAMPILLO_ID = 57;
  35. public const A_REVISAR_ID = 58;
  36. public const A_REVISAR_PAYPAL_ID = 59;
  37. public const DHL_ID = 74;
  38. public const UPS_ID = 80;
  39. public const DACHSER_ID = 83;
  40. public const AUSTRIAN_POST_ID = 94;
  41. public const PALLET_DELIVERY_ID = 99;
  42. public const FBA_ID = 150;
  43. public const PACK_AND_COLLECT_ID = 162;
  44. public const SPECIAL_PREPARATION_ID = 163;
  45. public const DHL_FREIGHT_ID = 185;
  46. public const STANDARD_SHIPMENT_ID = 308;
  47. public const FEDEX_ID = 410;
  48. public const RHENUS_ID = 422;
  49. public const STANDARD_SHIPMENT_NAME = 'Standard Shipment';
  50. public const WAREHOUSE_PICKUP_API_NAME = 'exw';
  51. public const PACK_AND_COLLECT_API_NAME = 'pc';
  52. public const ID_COLIS_PRIVE_HOME_DELIVERY_EASY = 359;
  53. public const ID_COLIS_PRIVE_HOME_DELIVERY_EASY_SIGNATURE = 382;
  54. public const SMART_SHIPMENT_CARRIER_MASTER_ID = 37;
  55. public const AERIAL_TRANSPORT_METHOD_ID = 3;
  56. public const PALLET_DELIVERY_NAME = 'Pallet Delivery';
  57. public const TRUCK_TRANSPORT_METHOD_ID = 1;
  58. public const SHIP_TRANSPORT_METHOD_ID = 2;
  59. public const PLANE_TRANSPORT_METHOD_ID = 3;
  60. public const VAN_TRANSPORT_METHOD_ID = 4;
  61. public const TRUCK_TRANSPORT_METHOD_NAME = 'truck';
  62. public const SHIP_TRANSPORT_METHOD_NAME = 'ship';
  63. public const PLANE_TRANSPORT_METHOD_NAME = 'plane';
  64. public const VAN_TRANSPORT_METHOD_NAME = 'van';
  65. public const PALLET_DELIVERY_CARRIERS = [self::PALLET_DELIVERY_ID, 100, 101, 102, 103, 104, 105, 106, 107, 108, 128, 129];
  66. public const DACHSER_EXCEPTIONS = [self::DACHSER_ID, 100, 101, 102, 103, 104, 105, 106, 107, 108, 128, 129];
  67. public const WEB_TRANSPORT_METHODS = [
  68. self::TRUCK_TRANSPORT_METHOD_ID => self::TRUCK_TRANSPORT_METHOD_NAME,
  69. self::SHIP_TRANSPORT_METHOD_ID => self::SHIP_TRANSPORT_METHOD_NAME,
  70. self::PLANE_TRANSPORT_METHOD_ID => self::PLANE_TRANSPORT_METHOD_NAME,
  71. self::VAN_TRANSPORT_METHOD_ID => self::VAN_TRANSPORT_METHOD_NAME,
  72. ];
  73. public const BOX_PACKAGING_METHOD_ID = 1;
  74. public const PALLET_PACKAGING_METHOD_ID = 2;
  75. public const POSTAL_PACKAGING_METHOD_ID = 3;
  76. public const BOX_PACKAGING_METHOD_NAME = 'box';
  77. public const PALLET_PACKAGING_METHOD_NAME = 'pallet';
  78. public const POSTAL_PACKAGING_METHOD_NAME = 'postal';
  79. public const WEB_PACKAGING_METHODS = [
  80. self::BOX_PACKAGING_METHOD_ID => self::BOX_PACKAGING_METHOD_NAME,
  81. self::PALLET_PACKAGING_METHOD_ID => self::PALLET_PACKAGING_METHOD_NAME,
  82. self::POSTAL_PACKAGING_METHOD_ID => self::POSTAL_PACKAGING_METHOD_NAME,
  83. ];
  84. public const WEB_PACKAGING_METHODS_WITH_POD = [
  85. self::BOX_PACKAGING_METHOD_ID,
  86. self::PALLET_PACKAGING_METHOD_ID,
  87. ];
  88. /**
  89. * @var int
  90. *
  91. * @ORM\Id()
  92. *
  93. * @ORM\GeneratedValue()
  94. *
  95. * @ORM\Column(name="id_carrier", type="integer", options={"unsigned":true})
  96. */
  97. private $id;
  98. /**
  99. * @var int
  100. *
  101. * @ORM\Column(name="id_reference", type="integer", length=10)
  102. */
  103. private $referenceId;
  104. /**
  105. * @var int|null
  106. *
  107. * @ORM\Column(name="id_tax_rules_group", type="integer", length=10, options={"unsigned": 0}, nullable=true)
  108. */
  109. private $taxRulesGroupId;
  110. /**
  111. * @var string
  112. *
  113. * @ORM\Column(type="string", length=64)
  114. */
  115. private $name;
  116. /**
  117. * @var string|null
  118. *
  119. * @ORM\Column(type="string", length=255, nullable=true)
  120. */
  121. private $url;
  122. /**
  123. * @var bool
  124. *
  125. * @ORM\Column(type="boolean", options={"default": 0})
  126. */
  127. private $active;
  128. /**
  129. * @var bool
  130. *
  131. * @ORM\Column(type="boolean", options={"default": 0})
  132. */
  133. private $deleted;
  134. /**
  135. * @var bool
  136. *
  137. * @ORM\Column(type="boolean", options={"default": 1})
  138. */
  139. private $shippingHandling;
  140. /**
  141. * @var bool
  142. *
  143. * @ORM\Column(type="boolean", options={"default": 0})
  144. */
  145. private $rangeBehavior;
  146. /**
  147. * @var bool
  148. *
  149. * @ORM\Column(type="boolean", options={"default": 0})
  150. */
  151. private $isModule;
  152. /**
  153. * @var bool
  154. *
  155. * @ORM\Column(type="boolean", options={"default": 0})
  156. */
  157. private $isFree;
  158. /**
  159. * @var bool
  160. *
  161. * @ORM\Column(type="boolean", options={"default": 0})
  162. */
  163. private $shippingExternal;
  164. /**
  165. * @var bool
  166. *
  167. * @ORM\Column(type="boolean", options={"default": 0})
  168. */
  169. private $needRange;
  170. /**
  171. * @var string|null
  172. *
  173. * @ORM\Column(type="string", length=64, nullable=true)
  174. */
  175. private $externalModuleName;
  176. /**
  177. * @var int
  178. *
  179. * @ORM\Column(type="integer", length=2, options={"default": 0})
  180. */
  181. private $shippingMethod;
  182. /**
  183. * @var int
  184. *
  185. * @ORM\Column(type="integer", length=10, options={"default": 0})
  186. */
  187. private $position;
  188. /**
  189. * @var int|null
  190. *
  191. * @ORM\Column(type="integer", length=10, options={"default": 0}, nullable=true)
  192. */
  193. private $maxWidth;
  194. /**
  195. * @var int|null
  196. *
  197. * @ORM\Column(type="integer", length=10, options={"default": 0}, nullable=true)
  198. */
  199. private $maxHeight;
  200. /**
  201. * @var int|null
  202. *
  203. * @ORM\Column(type="integer", length=10, options={"default": 0}, nullable=true)
  204. */
  205. private $maxDepth;
  206. /**
  207. * @var float|null
  208. *
  209. * @ORM\Column(type="float", options={"default" : 0.000000}, nullable=true)
  210. */
  211. private $maxWeight;
  212. /**
  213. * @var int|null
  214. *
  215. * @ORM\Column(type="integer", length=10, options={"default": 0}, nullable=true)
  216. */
  217. private $grade;
  218. /**
  219. * @var CarrierMaster
  220. *
  221. * @ORM\ManyToOne(targetEntity="App\Entity\System\CarrierMaster", inversedBy="carriers")
  222. *
  223. * @ORM\JoinColumn(name="id_carrier_master", referencedColumnName="id_carrier_master", nullable=false)
  224. */
  225. private $carrierMaster;
  226. /**
  227. * @var float
  228. *
  229. * @ORM\Column(name="vol_density", type="float", options={"default": 0})
  230. */
  231. private $volumenDensity;
  232. /**
  233. * @var int
  234. *
  235. * @ORM\Column(type="integer", length=2, options={"default": 1})
  236. */
  237. private $transportMethod;
  238. /**
  239. * @var int
  240. *
  241. * @ORM\Column(type="integer", length=2, options={"default": 1})
  242. */
  243. private $packagingMethod;
  244. /**
  245. * @var Warehouse
  246. *
  247. * @ORM\ManyToOne(targetEntity="App\Entity\System\Warehouse")
  248. *
  249. * @ORM\JoinColumn(nullable=false, name="id_warehouse", referencedColumnName="id")
  250. */
  251. private $warehouse;
  252. /**
  253. * @var bool
  254. *
  255. * @ORM\Column(name="free_shipping_allowed", type="boolean")
  256. */
  257. private $freeShippingAllowed;
  258. /**
  259. * @return int
  260. */
  261. public function getId(): int
  262. {
  263. return $this->id;
  264. }
  265. /**
  266. * @param int $id
  267. *
  268. * @return Carrier
  269. */
  270. public function setId(int $id): Carrier
  271. {
  272. $this->id = $id;
  273. return $this;
  274. }
  275. /**
  276. * @return int
  277. */
  278. public function getReferenceId(): int
  279. {
  280. return $this->referenceId;
  281. }
  282. /**
  283. * @param int $referenceId
  284. *
  285. * @return Carrier
  286. */
  287. public function setReferenceId(int $referenceId): Carrier
  288. {
  289. $this->referenceId = $referenceId;
  290. return $this;
  291. }
  292. /**
  293. * @return int|null
  294. */
  295. public function getTaxRulesGroupId(): ?int
  296. {
  297. return $this->taxRulesGroupId;
  298. }
  299. /**
  300. * @param int|null $taxRulesGroupId
  301. *
  302. * @return Carrier
  303. */
  304. public function setTaxRulesGroupId(?int $taxRulesGroupId): Carrier
  305. {
  306. $this->taxRulesGroupId = $taxRulesGroupId;
  307. return $this;
  308. }
  309. /**
  310. * @return string
  311. */
  312. public function getName(): string
  313. {
  314. return $this->name;
  315. }
  316. /**
  317. * @param string $name
  318. *
  319. * @return Carrier
  320. */
  321. public function setName(string $name): Carrier
  322. {
  323. $this->name = $name;
  324. return $this;
  325. }
  326. /**
  327. * @return string|null
  328. */
  329. public function getUrl(): ?string
  330. {
  331. return $this->url;
  332. }
  333. /**
  334. * @param string|null $url
  335. *
  336. * @return Carrier
  337. */
  338. public function setUrl(?string $url): Carrier
  339. {
  340. $this->url = $url;
  341. return $this;
  342. }
  343. public function getActive(): bool
  344. {
  345. return $this->active;
  346. }
  347. public function setActive(bool $active): Carrier
  348. {
  349. $this->active = $active;
  350. return $this;
  351. }
  352. public function getDeleted(): bool
  353. {
  354. return $this->deleted;
  355. }
  356. public function setDeleted(bool $deleted): Carrier
  357. {
  358. $this->deleted = $deleted;
  359. return $this;
  360. }
  361. public function getShippingHandling(): bool
  362. {
  363. return $this->shippingHandling;
  364. }
  365. public function setShippingHandling(bool $shippingHandling): Carrier
  366. {
  367. $this->shippingHandling = $shippingHandling;
  368. return $this;
  369. }
  370. public function getRangeBehavior(): bool
  371. {
  372. return $this->rangeBehavior;
  373. }
  374. public function setRangeBehavior(bool $rangeBehavior): Carrier
  375. {
  376. $this->rangeBehavior = $rangeBehavior;
  377. return $this;
  378. }
  379. public function getIsModule(): bool
  380. {
  381. return $this->isModule;
  382. }
  383. public function setIsModule(bool $isModule): Carrier
  384. {
  385. $this->isModule = $isModule;
  386. return $this;
  387. }
  388. public function getIsFree(): bool
  389. {
  390. return $this->isFree;
  391. }
  392. public function setIsFree(bool $isFree): Carrier
  393. {
  394. $this->isFree = $isFree;
  395. return $this;
  396. }
  397. public function getShippingExternal(): bool
  398. {
  399. return $this->shippingExternal;
  400. }
  401. public function setShippingExternal(bool $shippingExternal): Carrier
  402. {
  403. $this->shippingExternal = $shippingExternal;
  404. return $this;
  405. }
  406. public function getNeedRange(): bool
  407. {
  408. return $this->needRange;
  409. }
  410. public function setNeedRange(bool $needRange): Carrier
  411. {
  412. $this->needRange = $needRange;
  413. return $this;
  414. }
  415. /**
  416. * @return string|null
  417. */
  418. public function getExternalModuleName(): ?string
  419. {
  420. return $this->externalModuleName;
  421. }
  422. /**
  423. * @param string|null $externalModuleName
  424. *
  425. * @return Carrier
  426. */
  427. public function setExternalModuleName(?string $externalModuleName): Carrier
  428. {
  429. $this->externalModuleName = $externalModuleName;
  430. return $this;
  431. }
  432. /**
  433. * @return int
  434. */
  435. public function getShippingMethod(): int
  436. {
  437. return $this->shippingMethod;
  438. }
  439. /**
  440. * @param int $shippingMethod
  441. *
  442. * @return Carrier
  443. */
  444. public function setShippingMethod(int $shippingMethod): Carrier
  445. {
  446. $this->shippingMethod = $shippingMethod;
  447. return $this;
  448. }
  449. /**
  450. * @return int
  451. */
  452. public function getPosition(): int
  453. {
  454. return $this->position;
  455. }
  456. /**
  457. * @param int $position
  458. *
  459. * @return Carrier
  460. */
  461. public function setPosition(int $position): Carrier
  462. {
  463. $this->position = $position;
  464. return $this;
  465. }
  466. /**
  467. * @return int|null
  468. */
  469. public function getMaxWidth(): ?int
  470. {
  471. return $this->maxWidth;
  472. }
  473. /**
  474. * @param int|null $maxWidth
  475. *
  476. * @return Carrier
  477. */
  478. public function setMaxWidth(?int $maxWidth): Carrier
  479. {
  480. $this->maxWidth = $maxWidth;
  481. return $this;
  482. }
  483. /**
  484. * @return int|null
  485. */
  486. public function getMaxHeight(): ?int
  487. {
  488. return $this->maxHeight;
  489. }
  490. /**
  491. * @param int|null $maxHeight
  492. *
  493. * @return Carrier
  494. */
  495. public function setMaxHeight(?int $maxHeight): Carrier
  496. {
  497. $this->maxHeight = $maxHeight;
  498. return $this;
  499. }
  500. /**
  501. * @return int|null
  502. */
  503. public function getMaxDepth(): ?int
  504. {
  505. return $this->maxDepth;
  506. }
  507. /**
  508. * @param int|null $maxDepth
  509. *
  510. * @return Carrier
  511. */
  512. public function setMaxDepth(?int $maxDepth): Carrier
  513. {
  514. $this->maxDepth = $maxDepth;
  515. return $this;
  516. }
  517. /**
  518. * @return float|null
  519. */
  520. public function getMaxWeight(): ?float
  521. {
  522. return $this->maxWeight;
  523. }
  524. /**
  525. * @param float|null $maxWeight
  526. *
  527. * @return Carrier
  528. */
  529. public function setMaxWeight(?float $maxWeight): Carrier
  530. {
  531. $this->maxWeight = $maxWeight;
  532. return $this;
  533. }
  534. /**
  535. * @return int|null
  536. */
  537. public function getGrade(): ?int
  538. {
  539. return $this->grade;
  540. }
  541. /**
  542. * @param int|null $grade
  543. *
  544. * @return Carrier
  545. */
  546. public function setGrade(?int $grade): Carrier
  547. {
  548. $this->grade = $grade;
  549. return $this;
  550. }
  551. public function getCarrierMaster(): CarrierMaster
  552. {
  553. return $this->carrierMaster;
  554. }
  555. public function setCarrierMaster(CarrierMaster $carrierMaster): Carrier
  556. {
  557. $this->carrierMaster = $carrierMaster;
  558. return $this;
  559. }
  560. /**
  561. * @return float
  562. */
  563. public function getVolumenDensity(): float
  564. {
  565. return $this->volumenDensity;
  566. }
  567. /**
  568. * @param float $volumenDensity
  569. *
  570. * @return Carrier
  571. */
  572. public function setVolumenDensity(float $volumenDensity): Carrier
  573. {
  574. $this->volumenDensity = $volumenDensity;
  575. return $this;
  576. }
  577. /**
  578. * @return int
  579. */
  580. public function getTransportMethod(): int
  581. {
  582. return $this->transportMethod;
  583. }
  584. /**
  585. * @param int $transportMethod
  586. *
  587. * @return Carrier
  588. */
  589. public function setTransportMethod(int $transportMethod): Carrier
  590. {
  591. $this->transportMethod = $transportMethod;
  592. return $this;
  593. }
  594. /**
  595. * @return int
  596. */
  597. public function getPackagingMethod(): int
  598. {
  599. return $this->packagingMethod;
  600. }
  601. /**
  602. * @param int $packagingMethod
  603. *
  604. * @return Carrier
  605. */
  606. public function setPackagingMethod(int $packagingMethod): Carrier
  607. {
  608. $this->packagingMethod = $packagingMethod;
  609. return $this;
  610. }
  611. /**
  612. * @return Warehouse
  613. */
  614. public function getWarehouse(): Warehouse
  615. {
  616. return $this->warehouse;
  617. }
  618. /**
  619. * @param Warehouse $warehouse
  620. *
  621. * @return Carrier
  622. */
  623. public function setWarehouse(Warehouse $warehouse): Carrier
  624. {
  625. $this->warehouse = $warehouse;
  626. return $this;
  627. }
  628. public function isFreeShippingAllowed(): bool
  629. {
  630. return $this->freeShippingAllowed;
  631. }
  632. public function setIsFreeShippingAllowed(bool $freeShippingAllowed): Carrier
  633. {
  634. $this->freeShippingAllowed = $freeShippingAllowed;
  635. return $this;
  636. }
  637. }