-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Ratetimeintransit and Shoptimeintransit requests
RateTimeInTransit (replaces PR #145)
- Loading branch information
Showing
15 changed files
with
980 additions
and
51 deletions.
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
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,70 @@ | ||
<?php | ||
|
||
namespace Ups\Entity; | ||
|
||
use DOMDocument; | ||
use DOMElement; | ||
use Ups\NodeInterface; | ||
|
||
/** | ||
* @author mazzarito | ||
*/ | ||
class Arrival | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $date; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $time; | ||
|
||
/** | ||
* @param \stdClass|null $response | ||
*/ | ||
public function __construct(\stdClass $response = null) | ||
{ | ||
if (null !== $response) { | ||
if (isset($response->Date)) { | ||
$this->date = $response->Date; | ||
} | ||
if (isset($response->Time)) { | ||
$this->time = $response->Time; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDate() | ||
{ | ||
return $this->date; | ||
} | ||
|
||
/** | ||
* @param string $date | ||
*/ | ||
public function setDate($date) | ||
{ | ||
$this->date = $date; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTime() | ||
{ | ||
return $this->time; | ||
} | ||
|
||
/** | ||
* @param string $time | ||
*/ | ||
public function setTime($time) | ||
{ | ||
$this->time = $time; | ||
} | ||
} |
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,80 @@ | ||
<?php | ||
|
||
namespace Ups\Entity; | ||
|
||
use DOMDocument; | ||
use DOMElement; | ||
use Ups\NodeInterface; | ||
|
||
/** | ||
* @author mazzarito | ||
*/ | ||
class DeliveryTimeInformation implements NodeInterface | ||
{ | ||
const PBT_DOCUMENT_ONLY = '02'; | ||
const PBT_NON_DOCUMENT = '03'; | ||
const PBT_PALLET = '04'; | ||
|
||
/* | ||
* @var string | ||
*/ | ||
private $packageBillType; | ||
|
||
/* | ||
* @var Pickup | ||
*/ | ||
private $pickup; | ||
|
||
/** | ||
* @param null|DOMDocument $document | ||
* | ||
* @return DOMElement | ||
*/ | ||
public function toNode(DOMDocument $document = null) | ||
{ | ||
if (null === $document) { | ||
$document = new DOMDocument(); | ||
} | ||
|
||
$node = $document->createElement('DeliveryTimeInformation'); | ||
$node->appendChild($document->createElement('PackageBillType', $this->getPackageBillType())); | ||
|
||
if ($this->getPickup() !== null) { | ||
$node->appendChild($this->getPickup()->toNode($document)); | ||
} | ||
|
||
return $node; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getPackageBillType() | ||
{ | ||
return $this->packageBillType; | ||
} | ||
|
||
/** | ||
* @param string $packageBillType | ||
*/ | ||
public function setPackageBillType($packageBillType) | ||
{ | ||
$this->packageBillType = $packageBillType; | ||
} | ||
|
||
/** | ||
* @return Pickup | ||
*/ | ||
public function getPickup() | ||
{ | ||
return $this->pickup; | ||
} | ||
|
||
/** | ||
* @param Pickup $pickup | ||
*/ | ||
public function setPickup($pickup) | ||
{ | ||
$this->pickup = $pickup; | ||
} | ||
} |
Oops, something went wrong.