Skip to content

Commit d9a7f07

Browse files
committed
Add StatusType Code Constants Per UPS Tracking API Documentation
gonna get squashed also gonna get squashed
1 parent b2fa9a7 commit d9a7f07

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Entity/StatusType.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,23 @@
44

55
class StatusType
66
{
7+
const ST_IN_TRANSIT = 'I'; // In Transit
8+
const ST_DELIVERED = 'D'; // Delivered
9+
const ST_EXCEPTION = 'X'; // Exception
10+
const ST_PICKUP = 'P'; // Pickup
11+
const ST_MANIFEST_PICKUP = 'M'; // Manifest Pickup
12+
713
public $Code;
814
public $Description;
915

16+
private $statusTypeCodes = array(
17+
self::ST_IN_TRANSIT => "In Transit",
18+
self::ST_DELIVERED => "Delivered",
19+
self::ST_EXCEPTION => "Exception",
20+
self::ST_PICKUP => "Pickup",
21+
self::ST_MANIFEST_PICKUP => "Manifest Pickup"
22+
);
23+
1024
public function __construct($response = null)
1125
{
1226
if (null != $response) {
@@ -18,4 +32,12 @@ public function __construct($response = null)
1832
$this->Description = $response->Description;
1933
}
2034
}
35+
36+
/**
37+
* @return string
38+
*/
39+
public function getCodeName()
40+
{
41+
return $this->statusTypeCodes[$this->Code];
42+
}
2143
}

0 commit comments

Comments
 (0)