diff options
author | Filipp Lepalaan <filipp@mac.com> | 2011-05-04 10:01:01 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2011-05-04 10:01:01 +0300 |
commit | 7564c53dffb75c643dc32406ad0a939fa31d8833 (patch) | |
tree | 40a85bbac228b9e12945a4f8dcaaf6b0ccf39479 | |
parent | 650cfad53a1e24e08d02eaead58893e39765e208 (diff) | |
download | gsxlib-7564c53dffb75c643dc32406ad0a939fa31d8833.tar.gz gsxlib-7564c53dffb75c643dc32406ad0a939fa31d8833.tar.bz2 gsxlib-7564c53dffb75c643dc32406ad0a939fa31d8833.zip |
Added repairDetail()
-rw-r--r-- | gsxlib.php | 28 |
1 files changed, 23 insertions, 5 deletions
@@ -78,6 +78,24 @@ class GsxLib } /** + * Return details for given dispatch ID + * @param string $dispatchId + * @return object lookupResponseData + */ + public function repairDetails($dispatchId) + { + $dispatchId = trim($dispatchId); + + if (!self::looksLike($dispatchId, 'dispatchId')) { + exit('Invalid dispatch ID: ' . $dispatchId); + } + + $req = array('RepairDetails' => array('dispatchId' => $dispatchId)); + return $this->request($req)->lookupResponseData; + + } + + /** * a shortcut for looking up part information * @param mixed $string * @return [bool|string] @@ -111,11 +129,11 @@ class GsxLib $result = false; $rex = array( - 'partNumber' => '/^[a-z]?\d{3}\-\d{4}$/i', - 'serialNumber' => '/^[a-z0-9]{11,12}$/i', - 'eeeCode' => '/^[a-z0-9]{3,4}$/i', - 'repairNumber' => '/^\d{12}$/', - 'repairConfirmationNumber' => '/^G\d{9}$/i' + 'partNumber' => '/^[a-z]?\d{3}\-\d{4}$/i', + 'serialNumber' => '/^[a-z0-9]{11,12}$/i', + 'eeeCode' => '/^[a-z0-9]{3,4}$/i', + 'repairNumber' => '/^\d{12}$/', + 'dispatchId' => '/^G\d{9}$/i' ); foreach ($rex as $k => $v) { |