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 int
  122.      *
  123.      * @ORM\Column(type="boolean", options={"default": 0})
  124.      */
  125.     private $active;
  126.     /**
  127.      * @var int
  128.      *
  129.      * @ORM\Column(type="boolean", options={"default": 0})
  130.      */
  131.     private $deleted;
  132.     /**
  133.      * @var int
  134.      *
  135.      * @ORM\Column(type="boolean", options={"default": 1})
  136.      */
  137.     private $shippingHandling;
  138.     /**
  139.      * @var int
  140.      *
  141.      * @ORM\Column(type="boolean", options={"default": 0})
  142.      */
  143.     private $rangeBehavior;
  144.     /**
  145.      * @var int
  146.      *
  147.      * @ORM\Column(type="boolean", options={"default": 0})
  148.      */
  149.     private $isModule;
  150.     /**
  151.      * @var int
  152.      *
  153.      * @ORM\Column(type="boolean", options={"default": 0})
  154.      */
  155.     private $isFree;
  156.     /**
  157.      * @var int
  158.      *
  159.      * @ORM\Column(type="boolean", options={"default": 0})
  160.      */
  161.     private $shippingExternal;
  162.     /**
  163.      * @var int
  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 int
  218.      *
  219.      * @ORM\Column(name="id_carrier_master", type="integer", length=10, options={"default": 0})
  220.      */
  221.     private $carrierMasterId;
  222.     /**
  223.      * @var float
  224.      *
  225.      * @ORM\Column(name="vol_density", type="float", options={"default": 0})
  226.      */
  227.     private $volumenDensity;
  228.     /**
  229.      * @var string
  230.      *
  231.      * @ORM\Column(type="string", length=50, options={"default": "mag_shipping_matrixrate"})
  232.      */
  233.     private $tableShippingCost;
  234.     /**
  235.      * @var int
  236.      *
  237.      * @ORM\Column(type="integer", length=2, options={"default": 1})
  238.      */
  239.     private $transportMethod;
  240.     /**
  241.      * @var int
  242.      *
  243.      * @ORM\Column(type="integer", length=2, options={"default": 1})
  244.      */
  245.     private $packagingMethod;
  246.     /**
  247.      * @var Warehouse
  248.      *
  249.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Warehouse")
  250.      *
  251.      * @ORM\JoinColumn(nullable=false, name="id_warehouse", referencedColumnName="id")
  252.      */
  253.     private $warehouse;
  254.     /**
  255.      * @var bool
  256.      *
  257.      * @ORM\Column(name="free_shipping_allowed", type="boolean")
  258.      */
  259.     private $freeShippingAllowed;
  260.     /**
  261.      * @return int
  262.      */
  263.     public function getId(): int
  264.     {
  265.         return $this->id;
  266.     }
  267.     /**
  268.      * @param int $id
  269.      *
  270.      * @return Carrier
  271.      */
  272.     public function setId(int $id): Carrier
  273.     {
  274.         $this->id $id;
  275.         return $this;
  276.     }
  277.     /**
  278.      * @return int
  279.      */
  280.     public function getReferenceId(): int
  281.     {
  282.         return $this->referenceId;
  283.     }
  284.     /**
  285.      * @param int $referenceId
  286.      *
  287.      * @return Carrier
  288.      */
  289.     public function setReferenceId(int $referenceId): Carrier
  290.     {
  291.         $this->referenceId $referenceId;
  292.         return $this;
  293.     }
  294.     /**
  295.      * @return int|null
  296.      */
  297.     public function getTaxRulesGroupId(): ?int
  298.     {
  299.         return $this->taxRulesGroupId;
  300.     }
  301.     /**
  302.      * @param int|null $taxRulesGroupId
  303.      *
  304.      * @return Carrier
  305.      */
  306.     public function setTaxRulesGroupId(?int $taxRulesGroupId): Carrier
  307.     {
  308.         $this->taxRulesGroupId $taxRulesGroupId;
  309.         return $this;
  310.     }
  311.     /**
  312.      * @return string
  313.      */
  314.     public function getName(): string
  315.     {
  316.         return $this->name;
  317.     }
  318.     /**
  319.      * @param string $name
  320.      *
  321.      * @return Carrier
  322.      */
  323.     public function setName(string $name): Carrier
  324.     {
  325.         $this->name $name;
  326.         return $this;
  327.     }
  328.     /**
  329.      * @return string|null
  330.      */
  331.     public function getUrl(): ?string
  332.     {
  333.         return $this->url;
  334.     }
  335.     /**
  336.      * @param string|null $url
  337.      *
  338.      * @return Carrier
  339.      */
  340.     public function setUrl(?string $url): Carrier
  341.     {
  342.         $this->url $url;
  343.         return $this;
  344.     }
  345.     /**
  346.      * @return int
  347.      */
  348.     public function getActive(): int
  349.     {
  350.         return $this->active;
  351.     }
  352.     /**
  353.      * @param int $active
  354.      *
  355.      * @return Carrier
  356.      */
  357.     public function setActive(int $active): Carrier
  358.     {
  359.         $this->active $active;
  360.         return $this;
  361.     }
  362.     /**
  363.      * @return int
  364.      */
  365.     public function getDeleted(): int
  366.     {
  367.         return $this->deleted;
  368.     }
  369.     /**
  370.      * @param int $deleted
  371.      *
  372.      * @return Carrier
  373.      */
  374.     public function setDeleted(int $deleted): Carrier
  375.     {
  376.         $this->deleted $deleted;
  377.         return $this;
  378.     }
  379.     /**
  380.      * @return int
  381.      */
  382.     public function getShippingHandling(): int
  383.     {
  384.         return $this->shippingHandling;
  385.     }
  386.     /**
  387.      * @param int $shippingHandling
  388.      *
  389.      * @return Carrier
  390.      */
  391.     public function setShippingHandling(int $shippingHandling): Carrier
  392.     {
  393.         $this->shippingHandling $shippingHandling;
  394.         return $this;
  395.     }
  396.     /**
  397.      * @return int
  398.      */
  399.     public function getRangeBehavior(): int
  400.     {
  401.         return $this->rangeBehavior;
  402.     }
  403.     /**
  404.      * @param int $rangeBehavior
  405.      *
  406.      * @return Carrier
  407.      */
  408.     public function setRangeBehavior(int $rangeBehavior): Carrier
  409.     {
  410.         $this->rangeBehavior $rangeBehavior;
  411.         return $this;
  412.     }
  413.     /**
  414.      * @return int
  415.      */
  416.     public function getIsModule(): int
  417.     {
  418.         return $this->isModule;
  419.     }
  420.     /**
  421.      * @param int $isModule
  422.      *
  423.      * @return Carrier
  424.      */
  425.     public function setIsModule(int $isModule): Carrier
  426.     {
  427.         $this->isModule $isModule;
  428.         return $this;
  429.     }
  430.     /**
  431.      * @return int
  432.      */
  433.     public function getIsFree(): int
  434.     {
  435.         return $this->isFree;
  436.     }
  437.     /**
  438.      * @param int $isFree
  439.      *
  440.      * @return Carrier
  441.      */
  442.     public function setIsFree(int $isFree): Carrier
  443.     {
  444.         $this->isFree $isFree;
  445.         return $this;
  446.     }
  447.     /**
  448.      * @return int
  449.      */
  450.     public function getShippingExternal(): int
  451.     {
  452.         return $this->shippingExternal;
  453.     }
  454.     /**
  455.      * @param int $shippingExternal
  456.      *
  457.      * @return Carrier
  458.      */
  459.     public function setShippingExternal(int $shippingExternal): Carrier
  460.     {
  461.         $this->shippingExternal $shippingExternal;
  462.         return $this;
  463.     }
  464.     /**
  465.      * @return int
  466.      */
  467.     public function getNeedRange(): int
  468.     {
  469.         return $this->needRange;
  470.     }
  471.     /**
  472.      * @param int $needRange
  473.      *
  474.      * @return Carrier
  475.      */
  476.     public function setNeedRange(int $needRange): Carrier
  477.     {
  478.         $this->needRange $needRange;
  479.         return $this;
  480.     }
  481.     /**
  482.      * @return string|null
  483.      */
  484.     public function getExternalModuleName(): ?string
  485.     {
  486.         return $this->externalModuleName;
  487.     }
  488.     /**
  489.      * @param string|null $externalModuleName
  490.      *
  491.      * @return Carrier
  492.      */
  493.     public function setExternalModuleName(?string $externalModuleName): Carrier
  494.     {
  495.         $this->externalModuleName $externalModuleName;
  496.         return $this;
  497.     }
  498.     /**
  499.      * @return int
  500.      */
  501.     public function getShippingMethod(): int
  502.     {
  503.         return $this->shippingMethod;
  504.     }
  505.     /**
  506.      * @param int $shippingMethod
  507.      *
  508.      * @return Carrier
  509.      */
  510.     public function setShippingMethod(int $shippingMethod): Carrier
  511.     {
  512.         $this->shippingMethod $shippingMethod;
  513.         return $this;
  514.     }
  515.     /**
  516.      * @return int
  517.      */
  518.     public function getPosition(): int
  519.     {
  520.         return $this->position;
  521.     }
  522.     /**
  523.      * @param int $position
  524.      *
  525.      * @return Carrier
  526.      */
  527.     public function setPosition(int $position): Carrier
  528.     {
  529.         $this->position $position;
  530.         return $this;
  531.     }
  532.     /**
  533.      * @return int|null
  534.      */
  535.     public function getMaxWidth(): ?int
  536.     {
  537.         return $this->maxWidth;
  538.     }
  539.     /**
  540.      * @param int|null $maxWidth
  541.      *
  542.      * @return Carrier
  543.      */
  544.     public function setMaxWidth(?int $maxWidth): Carrier
  545.     {
  546.         $this->maxWidth $maxWidth;
  547.         return $this;
  548.     }
  549.     /**
  550.      * @return int|null
  551.      */
  552.     public function getMaxHeight(): ?int
  553.     {
  554.         return $this->maxHeight;
  555.     }
  556.     /**
  557.      * @param int|null $maxHeight
  558.      *
  559.      * @return Carrier
  560.      */
  561.     public function setMaxHeight(?int $maxHeight): Carrier
  562.     {
  563.         $this->maxHeight $maxHeight;
  564.         return $this;
  565.     }
  566.     /**
  567.      * @return int|null
  568.      */
  569.     public function getMaxDepth(): ?int
  570.     {
  571.         return $this->maxDepth;
  572.     }
  573.     /**
  574.      * @param int|null $maxDepth
  575.      *
  576.      * @return Carrier
  577.      */
  578.     public function setMaxDepth(?int $maxDepth): Carrier
  579.     {
  580.         $this->maxDepth $maxDepth;
  581.         return $this;
  582.     }
  583.     /**
  584.      * @return float|null
  585.      */
  586.     public function getMaxWeight(): ?float
  587.     {
  588.         return $this->maxWeight;
  589.     }
  590.     /**
  591.      * @param float|null $maxWeight
  592.      *
  593.      * @return Carrier
  594.      */
  595.     public function setMaxWeight(?float $maxWeight): Carrier
  596.     {
  597.         $this->maxWeight $maxWeight;
  598.         return $this;
  599.     }
  600.     /**
  601.      * @return int|null
  602.      */
  603.     public function getGrade(): ?int
  604.     {
  605.         return $this->grade;
  606.     }
  607.     /**
  608.      * @param int|null $grade
  609.      *
  610.      * @return Carrier
  611.      */
  612.     public function setGrade(?int $grade): Carrier
  613.     {
  614.         $this->grade $grade;
  615.         return $this;
  616.     }
  617.     /**
  618.      * @return int
  619.      */
  620.     public function getCarrierMasterId(): int
  621.     {
  622.         return $this->carrierMasterId;
  623.     }
  624.     /**
  625.      * @param int $carrierMasterId
  626.      *
  627.      * @return Carrier
  628.      */
  629.     public function setCarrierMasterId(int $carrierMasterId): Carrier
  630.     {
  631.         $this->carrierMasterId $carrierMasterId;
  632.         return $this;
  633.     }
  634.     /**
  635.      * @return float
  636.      */
  637.     public function getVolumenDensity(): float
  638.     {
  639.         return $this->volumenDensity;
  640.     }
  641.     /**
  642.      * @param float $volumenDensity
  643.      *
  644.      * @return Carrier
  645.      */
  646.     public function setVolumenDensity(float $volumenDensity): Carrier
  647.     {
  648.         $this->volumenDensity $volumenDensity;
  649.         return $this;
  650.     }
  651.     /**
  652.      * @return string
  653.      */
  654.     public function getTableShippingCost(): string
  655.     {
  656.         return $this->tableShippingCost;
  657.     }
  658.     /**
  659.      * @param string $tableShippingCost
  660.      *
  661.      * @return Carrier
  662.      */
  663.     public function setTableShippingCost(string $tableShippingCost): Carrier
  664.     {
  665.         $this->tableShippingCost $tableShippingCost;
  666.         return $this;
  667.     }
  668.     /**
  669.      * @return int
  670.      */
  671.     public function getTransportMethod(): int
  672.     {
  673.         return $this->transportMethod;
  674.     }
  675.     /**
  676.      * @param int $transportMethod
  677.      *
  678.      * @return Carrier
  679.      */
  680.     public function setTransportMethod(int $transportMethod): Carrier
  681.     {
  682.         $this->transportMethod $transportMethod;
  683.         return $this;
  684.     }
  685.     /**
  686.      * @return int
  687.      */
  688.     public function getPackagingMethod(): int
  689.     {
  690.         return $this->packagingMethod;
  691.     }
  692.     /**
  693.      * @param int $packagingMethod
  694.      *
  695.      * @return Carrier
  696.      */
  697.     public function setPackagingMethod(int $packagingMethod): Carrier
  698.     {
  699.         $this->packagingMethod $packagingMethod;
  700.         return $this;
  701.     }
  702.     /**
  703.      * @return Warehouse
  704.      */
  705.     public function getWarehouse(): Warehouse
  706.     {
  707.         return $this->warehouse;
  708.     }
  709.     /**
  710.      * @param Warehouse $warehouse
  711.      *
  712.      * @return Carrier
  713.      */
  714.     public function setWarehouse(Warehouse $warehouse): Carrier
  715.     {
  716.         $this->warehouse $warehouse;
  717.         return $this;
  718.     }
  719.     /**
  720.      * @return bool
  721.      */
  722.     public function isFreeShippingAllowed(): bool
  723.     {
  724.         return $this->freeShippingAllowed;
  725.     }
  726. }