src/Entity/System/Carrier.php line 12

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