This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Adiconquerors/master
New Nodes Implemented
- Loading branch information
Showing
12 changed files
with
777 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?php | ||
namespace alexLE\DHLExpress; | ||
|
||
|
||
class ExportDeclaration extends DataClass { | ||
|
||
/** | ||
* @var ExportLineItems | ||
*/ | ||
protected $exportLineItems; | ||
|
||
/** | ||
* @var OtherCharges | ||
*/ | ||
protected $otherCharges; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $invoiceDate; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $invoiceNumber; | ||
|
||
/** | ||
* @return ExportLineItems | ||
*/ | ||
public function getExportLineItems() { | ||
return $this->exportLineItems; | ||
} | ||
|
||
/** | ||
* @param ExportLineItems $contact | ||
* @return ExportDeclaration | ||
*/ | ||
public function setExportLineItems(ExportLineItems $exportLineItems) { | ||
$this->exportLineItems = $exportLineItems; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getInvoiceNumber() { | ||
return $this->invoiceNumber; | ||
} | ||
|
||
/** | ||
* @param string $invoiceNumber | ||
* @return ExportLineItems | ||
*/ | ||
public function setInvoiceNumber($invoiceNumber) { | ||
$this->invoiceNumber = $invoiceNumber; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getInvoiceDate() { | ||
return $this->invoiceDate; | ||
} | ||
|
||
/** | ||
* @param string $invoiceDate | ||
* @return ExportLineItems | ||
*/ | ||
public function setInvoiceDate($invoiceDate) { | ||
$this->invoiceDate = $invoiceDate; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getOtherCharges() { | ||
return $this->otherCharges; | ||
} | ||
|
||
/** | ||
* @param string $invoiceDate | ||
* @return ExportLineItems | ||
*/ | ||
public function setOtherCharges(OtherCharges $otherCharges) { | ||
$this->otherCharges = $otherCharges; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function buildData() { | ||
return [ | ||
'ExportLineItems' => $this->exportLineItems->buildData(), | ||
'InvoiceDate' => $this->invoiceDate, | ||
'InvoiceNumber' => $this->invoiceNumber, | ||
'OtherCharges' => $this->otherCharges->buildData(), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
<?php | ||
namespace alexLE\DHLExpress; | ||
|
||
|
||
class ExportLineItem extends DataClass { | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $itemNumber; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $quantity; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $quantityUnitOfMeasurement; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $itemDescription; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $unitPrice; | ||
|
||
/** | ||
* @var number | ||
*/ | ||
protected $netWeight; | ||
|
||
/** | ||
* @var number | ||
*/ | ||
protected $grossWeight; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $manufacturingCountryCode; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getItemNumber() { | ||
return $this->itemNumber; | ||
} | ||
|
||
/** | ||
* @param string $itemNumber | ||
* @return ExportLineItem | ||
*/ | ||
public function setItemNumber($itemNumber) { | ||
$this->itemNumber = $itemNumber; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getQuantity() { | ||
return $this->companyName; | ||
} | ||
|
||
/** | ||
* @param string $quantity | ||
* @return ExportLineItem | ||
*/ | ||
public function setQuantity($quantity) { | ||
$this->quantity = $quantity; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getQuantityUnitOfMeasurement() { | ||
return $this->quantityUnitOfMeasurement; | ||
} | ||
|
||
/** | ||
* @param string $quantityUnitOfMeasurement | ||
* @return ExportLineItem | ||
*/ | ||
public function setQuantityUnitOfMeasurement($quantityUnitOfMeasurement) { | ||
$this->quantityUnitOfMeasurement = $quantityUnitOfMeasurement; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getItemDescription() { | ||
return $this->itemDescription; | ||
} | ||
|
||
/** | ||
* @param string $itemDescription | ||
* @return ExportLineItem | ||
*/ | ||
public function setItemDescription($itemDescription) { | ||
$this->itemDescription = $itemDescription; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUnitPrice() { | ||
return $this->unitPrice; | ||
} | ||
|
||
/** | ||
* @param string $unitPrice | ||
* @return ExportLineItem | ||
*/ | ||
public function setUnitPrice($unitPrice) { | ||
$this->unitPrice = $unitPrice; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getNetWeight() { | ||
return $this->netWeight; | ||
} | ||
|
||
/** | ||
* @param string $netWeight | ||
* @return ExportLineItem | ||
*/ | ||
public function setNetWeight($netWeight) { | ||
$this->netWeight = $netWeight; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getGrossWeight() { | ||
return $this->grossWeight; | ||
} | ||
|
||
/** | ||
* @param string $grossWeight | ||
* @return ExportLineItem | ||
*/ | ||
public function setGrossWeight($grossWeight) { | ||
$this->grossWeight = $grossWeight; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getManufacturingCountryCode() { | ||
return $this->manufacturingCountryCode; | ||
} | ||
|
||
/** | ||
* @param string $manufacturingCountryCode | ||
* @return ExportLineItem | ||
*/ | ||
public function setManufacturingCountryCode($manufacturingCountryCode) { | ||
$this->manufacturingCountryCode = $manufacturingCountryCode; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function buildData() { | ||
$result = [ | ||
'ItemNumber' => $this->itemNumber, | ||
'Quantity' => $this->quantity, | ||
'QuantityUnitOfMeasurement' => $this->quantityUnitOfMeasurement, | ||
|
||
'ItemDescription' => $this->itemDescription, | ||
'UnitPrice' => $this->unitPrice, | ||
'NetWeight' => $this->netWeight, | ||
|
||
'GrossWeight' => $this->grossWeight, | ||
'ManufacturingCountryCode' => $this->manufacturingCountryCode, | ||
]; | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
namespace alexLE\DHLExpress; | ||
|
||
|
||
class ExportLineItems extends DataClass { | ||
|
||
/** | ||
* @var ExportLineItem[] | ||
*/ | ||
protected $exportLineItems; | ||
|
||
function __construct() { | ||
$this->exportLineItems = []; | ||
} | ||
|
||
/** | ||
* @return ExportLineItem[] | ||
*/ | ||
public function getRequestedPackages() { | ||
return $this->exportLineItems; | ||
} | ||
|
||
/** | ||
* @param ExportLineItem $exportLineItem | ||
* @return ExportLineItems | ||
*/ | ||
public function addexportLineItem(ExportLineItem $exportLineItem) { | ||
$this->exportLineItems[] = $exportLineItem; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @return array | ||
*/ | ||
public function buildData() { | ||
/* | ||
$result = [ | ||
'ExportLineItem' => $this->exportLineItem->buildData(), | ||
]; | ||
return $result; | ||
*/ | ||
|
||
$result = ['ExportLineItem' => []]; | ||
|
||
foreach($this->exportLineItems as $index => $exportLineItem) { | ||
// @number has to be the first entry, otherwise the API returns a error 500 | ||
$packageData = [ | ||
'ItemNumber' => $index + 1 | ||
]; | ||
$packageData = array_merge($packageData, $exportLineItem->buildData()); | ||
|
||
$result['ExportLineItem'][] = $packageData; | ||
} | ||
|
||
return $result; | ||
} | ||
} |
Oops, something went wrong.