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