PluginProbe
Packeta / 1.4
Packeta v1.4
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 1.4, at src/Packetery/Core/Api/Soap/Response/PacketsCourierLabelsPdf.php

90 lines 1.6 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\ResponseTrait;
13
14 /**
15 * Class PacketsCourierLabelsPdf.
16 *
17 * @package Packetery\Api\Soap\Response
18 */
19 class PacketsCourierLabelsPdf extends BaseResponse {
20
21 use ResponseTrait\InvalidPacketIds;
22
23 /**
24 * Pdf contents.
25 *
26 * @var string
27 */
28 private $pdfContents;
29
30 /**
31 * Invalid courier numbers.
32 *
33 * @var array
34 */
35 private $invalidCourierNumbers = [];
36
37 /**
38 * Sets pdf contents.
39 *
40 * @param string $pdfContents Pdf contents.
41 */
42 public function setPdfContents( string $pdfContents ): void {
43 $this->pdfContents = $pdfContents;
44 }
45
46 /**
47 * Gets pdf contents.
48 *
49 * @return string
50 */
51 public function getPdfContents(): string {
52 return $this->pdfContents;
53 }
54
55 /**
56 * Sets invalid courier numbers.
57 *
58 * @param array $invalidCourierNumbers Invalid courier numbers.
59 *
60 * @return void
61 */
62 public function setInvalidCourierNumbers( array $invalidCourierNumbers ): void {
63 $this->invalidCourierNumbers = $invalidCourierNumbers;
64 }
65
66 /**
67 * Gets invalid courier numbers.
68 *
69 * @return array
70 */
71 public function getInvalidCourierNumbers(): array {
72 return $this->invalidCourierNumbers;
73 }
74
75 /**
76 * Tells if response has invalid courier number.
77 *
78 * @param string $courierNumber Courier number.
79 *
80 * @return bool|null
81 */
82 public function hasInvalidCourierNumber( string $courierNumber ): ?bool {
83 if ( in_array( $courierNumber, $this->invalidCourierNumbers, true ) ) {
84 return true;
85 }
86
87 return null;
88 }
89 }
90