Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit 7178ef4

Browse files
committed
Added missing implementation for manifest data in response
1 parent 26a7e9a commit 7178ef4

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

includes/Response.php

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Authors-Website: http://petschko.org/
88
* Date: 18.11.2016
99
* Time: 16:00
10-
* Update: 17.07.2018
11-
* Version: 1.1.3
10+
* Update: 06.08.2018
11+
* Version: 1.2.0
1212
*
1313
* Notes: Contains the DHL-Response Class, which manages the response that you get with simple getters
1414
*/
@@ -75,6 +75,13 @@ class Response extends Version {
7575
*/
7676
private $exportDoc = null;
7777

78+
/**
79+
* Manifest PDF-Data as Base64-String
80+
*
81+
* @var null|string $manifestData - Manifest PDF-Data as Base64 String or null if not requested
82+
*/
83+
private $manifestData = null;
84+
7885
/**
7986
* Label-Response-Type (Base64 or URL)
8087
*
@@ -155,6 +162,7 @@ public function __destruct() {
155162
unset($this->label);
156163
unset($this->returnLabel);
157164
unset($this->exportDoc);
165+
unset($this->manifestData);
158166
unset($this->labelType);
159167
unset($this->sequenceNumber);
160168
unset($this->statusCode);
@@ -260,6 +268,24 @@ private function setExportDoc($exportDoc) {
260268
$this->exportDoc = $exportDoc;
261269
}
262270

271+
/**
272+
* Get the Manifest PDF-Data as Base64-String
273+
*
274+
* @return null|string - PDF-Data as Base64-String or null if empty/not requested
275+
*/
276+
public function getManifestData() {
277+
return $this->manifestData;
278+
}
279+
280+
/**
281+
* Set the Manifest PDF-Data as Base64-String
282+
*
283+
* @param null|string $manifestData - PDF-Data as Base64-String or null for none
284+
*/
285+
private function setManifestData($manifestData) {
286+
$this->manifestData = $manifestData;
287+
}
288+
263289
/**
264290
* Getter for Label-Response-Type
265291
*
@@ -409,11 +435,14 @@ private function loadResponse_v2($response) {
409435
! isset($response->ExportDocData->Status->statusCode) &&
410436
! isset($response->ValidationState->Status->statusCode)
411437
) {
412-
// Set fault Status-Code
438+
// Set fault Status-Code | Set short responses
413439
$this->setStatusCode((int) $response->Status->statusCode);
414440
$this->setStatusText($response->Status->statusText);
415441
$this->setStatusMessage($response->Status->statusMessage);
416442

443+
if(isset($response->manifestData))
444+
$this->setManifestData($response->manifestData);
445+
417446
return;
418447
}
419448

0 commit comments

Comments
 (0)