TrackPackageResult
in package
implements
JsonSerializable
Class TrackPackageResult
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- $events : array<string|int, mixed>|null
- A list of tracking events that have occurred on a given shipment/tracking number, up to the time of the request. Each event is of type `TrackingEvent`.
- $package : Package|null
- A Package object representing the package data associated with a given shipment/tracking number.
- $shipment : Shipment|null
- The shipment object that is related to the tracking data and is returned from ShipEngine API.
- __construct() : mixed
- TrackPackageResult constructor. This object is the return type for the `trackPackage` method in the `TrackPackageService`.
- getErrors() : array<string|int, mixed>
- Returns **only** the EXCEPTION events.
- getLatestEvent() : TrackingEvent
- This is the latest event to have occurred in the `$events` array.
- hasErrors() : bool
- Returns `true` if there are any EXCEPTION events.
- jsonSerialize() : mixed
- Specify data which should be serialized to JSON
Properties
$events
A list of tracking events that have occurred on a given shipment/tracking number, up to the time of the request. Each event is of type `TrackingEvent`.
public
array<string|int, mixed>|null
$events
= array()
$package
A Package object representing the package data associated with a given shipment/tracking number.
public
Package|null
$package
$shipment
The shipment object that is related to the tracking data and is returned from ShipEngine API.
public
Shipment|null
$shipment
Methods
__construct()
TrackPackageResult constructor. This object is the return type for the `trackPackage` method in the `TrackPackageService`.
public
__construct(array<string|int, mixed> $apiResponse, ShipEngineConfig $config) : mixed
Parameters
- $apiResponse : array<string|int, mixed>
- $config : ShipEngineConfig
Return values
mixed —getErrors()
Returns **only** the EXCEPTION events.
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —getLatestEvent()
This is the latest event to have occurred in the `$events` array.
public
getLatestEvent() : TrackingEvent
Return values
TrackingEvent —hasErrors()
Returns `true` if there are any EXCEPTION events.
public
hasErrors() : bool
Return values
bool —jsonSerialize()
Specify data which should be serialized to JSON
public
jsonSerialize() : mixed