Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data Fields | Protected Member Functions
AbstractDhl Class Reference
Inheritance diagram for AbstractDhl:
AbstractCarrierOnline AbstractCarrier DataObject AbstractCarrierInterface Carrier

Data Fields

const CONDITION_CODE_SERVICE_DATE_UNAVAILABLE = 1003
 
const UNAVAILABLE_DATE_LOOK_FORWARD = 5
 
const REQUEST_DATE_FORMAT = 'Y-m-d'
 
- Data Fields inherited from AbstractCarrierOnline
const USA_COUNTRY_ID = 'US'
 
const PUERTORICO_COUNTRY_ID = 'PR'
 
const GUAM_COUNTRY_ID = 'GU'
 
const GUAM_REGION_CODE = 'GU'
 
- Data Fields inherited from AbstractCarrier
const DEBUG_KEYS_MASK = '****'
 
const USA_COUNTRY_ID = 'US'
 
const CANADA_COUNTRY_ID = 'CA'
 
const MEXICO_COUNTRY_ID = 'MX'
 
const HANDLING_TYPE_PERCENT = 'P'
 
const HANDLING_TYPE_FIXED = 'F'
 
const HANDLING_ACTION_PERPACKAGE = 'P'
 
const HANDLING_ACTION_PERORDER = 'O'
 

Protected Member Functions

 _getShipDate ()
 
 _determineShippingDay ($shippingDays, $date)
 
- Protected Member Functions inherited from AbstractCarrierOnline
 _getQuotesCacheKey ($requestParams)
 
 _getCachedQuotes ($requestParams)
 
 _setCachedQuotes ($requestParams, $response)
 
 _prepareServiceName ($name)
 
 _prepareShipmentRequest (\Magento\Framework\DataObject $request)
 
 _doShipmentRequest (\Magento\Framework\DataObject $request)
 
 _isUSCountry ($countyId)
 
 debugErrors ($errors)
 
 getErrorMessage ()
 
- Protected Member Functions inherited from AbstractCarrier
 _getAllowedContainers (\Magento\Framework\DataObject $params=null)
 
 _updateFreeMethodQuote ($request)
 
 _getPerpackagePrice ($cost, $handlingType, $handlingFee)
 
 _getPerorderPrice ($cost, $handlingType, $handlingFee)
 
 _debug ($debugData)
 
 filterDebugData ($data)
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Additional Inherited Members

- Public Member Functions inherited from AbstractCarrierOnline
 __construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, Security $xmlSecurity, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory, \Magento\Shipping\Model\Tracking\Result\ErrorFactory $trackErrorFactory, \Magento\Shipping\Model\Tracking\Result\StatusFactory $trackStatusFactory, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, array $data=[])
 
 setActiveFlag ($code='active')
 
 getCarrierCode ()
 
 getTrackingInfo ($tracking)
 
 isTrackingAvailable ()
 
 isCityRequired ()
 
 isZipCodeRequired ($countryId=null)
 
 isShippingLabelsAvailable ()
 
 getAllItems (RateRequest $request)
 
 proccessAdditionalValidation (\Magento\Framework\DataObject $request)
 
 requestToShipment ($request)
 
 returnOfShipment ($request)
 
 rollBack ($data)
 
 isGirthAllowed ($countyDest=null, $carrierMethodCode=null)
 
 setRawRequest ($request)
 
 getMethodPrice ($cost, $method='')
 
 parseXml ($xmlContent, $customSimplexml='SimpleXMLElement')
 
 canCollectRates ()
 
- Public Member Functions inherited from AbstractCarrier
 __construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, array $data=[])
 
 getConfigData ($field)
 
 getConfigFlag ($field)
 
 requestToShipment ($request)
 
 returnOfShipment ($request)
 
 getContainerTypes (\Magento\Framework\DataObject $params=null)
 
 getCustomizableContainerTypes ()
 
 getDeliveryConfirmationTypes (\Magento\Framework\DataObject $params=null)
 
 processAdditionalValidation (\Magento\Framework\DataObject $request)
 
 proccessAdditionalValidation (\Magento\Framework\DataObject $request)
 
 isActive ()
 
 isFixed ()
 
 isTrackingAvailable ()
 
 isShippingLabelsAvailable ()
 
 getSortOrder ()
 
 getFinalPriceWithHandlingFee ($cost)
 
 getTotalNumOfBoxes ($weight)
 
 isStateProvinceRequired ()
 
 isCityRequired ()
 
 isZipCodeRequired ($countryId=null)
 
 getDebugFlag ()
 
 debugData ($debugData)
 
 getCarrierCode ()
 
 getContentTypes (\Magento\Framework\DataObject $params)
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from AbstractCarrierInterface
 collectRates (RateRequest $request)
 
 checkAvailableShipCountries (\Magento\Framework\DataObject $request)
 
- Protected Attributes inherited from AbstractCarrierOnline
 $_activeFlag = 'active'
 
 $_directoryData = null
 
 $_xmlElFactory
 
 $_rateFactory
 
 $_rateMethodFactory
 
 $_trackFactory
 
 $_trackErrorFactory
 
 $_trackStatusFactory
 
 $_regionFactory
 
 $_countryFactory
 
 $_currencyFactory
 
 $stockRegistry
 
 $_rawRequest = null
 
 $xmlSecurity
 
- Protected Attributes inherited from AbstractCarrier
 $_code
 
 $_rates
 
 $_numBoxes = 1
 
 $_freeMethod = 'free_method'
 
 $_isFixed = false
 
 $_customizableContainerTypes = []
 
 $_debugReplacePrivateDataKeys = []
 
 $_scopeConfig
 
 $_rateErrorFactory
 
 $_logger
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from AbstractCarrierOnline
static $_quotesCache = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Definition at line 10 of file AbstractDhl.php.

Member Function Documentation

◆ _determineShippingDay()

_determineShippingDay (   $shippingDays,
  $date 
)
protected

Determine shipping day according to configuration settings

Parameters
string[]$shippingDays
string$date
Returns
string

Definition at line 44 of file AbstractDhl.php.

45  {
46  if (empty($shippingDays)) {
47  return $date;
48  }
49 
50  $shippingDays = explode(',', $shippingDays);
51 
52  $i = -1;
53  do {
54  $i++;
55  $weekday = date('D', strtotime("{$date} +{$i} day"));
56  } while (!in_array($weekday, $shippingDays) && $i < 10);
57 
58  return date(self::REQUEST_DATE_FORMAT, strtotime("{$date} +{$i} day"));
59  }
$i
Definition: gallery.phtml:31

◆ _getShipDate()

_getShipDate ( )
protected

Get shipping date

Returns
string

Definition at line 32 of file AbstractDhl.php.

33  {
34  return $this->_determineShippingDay($this->getConfigData('shipment_days'), date(self::REQUEST_DATE_FORMAT));
35  }
_determineShippingDay($shippingDays, $date)
Definition: AbstractDhl.php:44

Field Documentation

◆ CONDITION_CODE_SERVICE_DATE_UNAVAILABLE

const CONDITION_CODE_SERVICE_DATE_UNAVAILABLE = 1003

Response condition code for service is unavailable at the requested date

Definition at line 15 of file AbstractDhl.php.

◆ REQUEST_DATE_FORMAT

const REQUEST_DATE_FORMAT = 'Y-m-d'

Date format for request

Definition at line 25 of file AbstractDhl.php.

◆ UNAVAILABLE_DATE_LOOK_FORWARD

const UNAVAILABLE_DATE_LOOK_FORWARD = 5

Count of days to look forward if day is not unavailable

Definition at line 20 of file AbstractDhl.php.


The documentation for this class was generated from the following file: