PluginProbe
Packeta / 2.3.1
Packeta v2.3.1
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / src / Packetery / Core / Api / Soap / Response / PacketsCourierLabelsPdf.php

PacketsCourierLabelsPdf.php in Packeta 2.3.1, at src/Packetery/Core/Api/Soap/Response/PacketsCourierLabelsPdf.php

91 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class PacketsCourierLabelsPdf.
4 *
5 * @package Packetery\Api\Soap\Response
6 */
7
8 declare( strict_types=1 );
9
10 namespace Packetery\Core\Api\Soap\Response;
11
12 use Packetery\Core\Api\Soap\ILabelResponse;
13 use Packetery\Core\Api\Soap\ResponseTrait;
14
15 /**
16 * Class PacketsCourierLabelsPdf.
17 *
18 * @package Packetery\Api\Soap\Response
19 */
20 class PacketsCourierLabelsPdf extends BaseResponse implements ILabelResponse {
21
22 use ResponseTrait\InvalidPacketIds;
23
24 /**
25 * Pdf contents.
26 *
27 * @var string
28 */
29 private $pdfContents;
30
31 /**
32 * Invalid courier numbers.
33 *
34 * @var string[]
35 */
36 private $invalidCourierNumbers = [];
37
38 /**
39 * Sets pdf contents.
40 *
41 * @param string $pdfContents Pdf contents.
42 */
43 public function setPdfContents( string $pdfContents ): void {
44 $this->pdfContents = $pdfContents;
45 }
46
47 /**
48 * Gets pdf contents.
49 *
50 * @return string
51 */
52 public function getPdfContents(): string {
53 return $this->pdfContents;
54 }
55
56 /**
57 * Sets invalid courier numbers.
58 *
59 * @param string[] $invalidCourierNumbers Invalid courier numbers.
60 *
61 * @return void
62 */
63 public function setInvalidCourierNumbers( array $invalidCourierNumbers ): void {
64 $this->invalidCourierNumbers = $invalidCourierNumbers;
65 }
66
67 /**
68 * Gets invalid courier numbers.
69 *
70 * @return string[]
71 */
72 public function getInvalidCourierNumbers(): array {
73 return $this->invalidCourierNumbers;
74 }
75
76 /**
77 * Tells if response has invalid courier number.
78 *
79 * @param string $courierNumber Courier number.
80 *
81 * @return bool|null
82 */
83 public function hasInvalidCourierNumber( string $courierNumber ): ?bool {
84 if ( in_array( $courierNumber, $this->invalidCourierNumbers, true ) ) {
85 return true;
86 }
87
88 return null;
89 }
90 }
91