1 | <?php |
||
19 | class RecipientDevice |
||
20 | { |
||
21 | /** |
||
22 | * Device identifier statuses |
||
23 | */ |
||
24 | const DEVICE_ACTUAL = 1; |
||
25 | const DEVICE_NOT_READY = 2; |
||
26 | const DEVICE_NOT_REGISTERED = 3; |
||
27 | const IDENTIFIER_NEED_TO_BE_REPLACED = 4; |
||
28 | |||
29 | /** |
||
30 | * Recipient device identifier |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | private $identifier; |
||
35 | |||
36 | /** |
||
37 | * Current status |
||
38 | * |
||
39 | * @var int |
||
40 | */ |
||
41 | private $identifierStatus; |
||
42 | |||
43 | /** |
||
44 | * Sender should replace the ID on future requests |
||
45 | * @var string |
||
46 | */ |
||
47 | private $idToReplaceTo; |
||
48 | |||
49 | /** |
||
50 | * @param string $deviceIdentifier |
||
51 | * @param MessageInterface $message |
||
52 | */ |
||
53 | public function __construct($deviceIdentifier, MessageInterface $message) |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getIdentifier() |
||
68 | |||
69 | /** |
||
70 | * @param string $identifier |
||
71 | * @param MessageInterface $message |
||
72 | * @return $this |
||
73 | * @throws InvalidArgumentException |
||
74 | */ |
||
75 | public function setIdentifier($identifier, MessageInterface $message) |
||
84 | |||
85 | /** |
||
86 | * @return int |
||
87 | */ |
||
88 | public function getIdentifierStatus() |
||
92 | |||
93 | /** |
||
94 | * @param int $identifierStatus |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function setIdentifierStatus($identifierStatus) |
||
111 | |||
112 | /** |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getIdToReplaceTo() |
||
119 | |||
120 | /** |
||
121 | * @param string $idToReplaceTo |
||
122 | * @return $this |
||
123 | */ |
||
124 | public function setIdToReplaceTo($idToReplaceTo) |
||
130 | |||
131 | /** |
||
132 | * @return bool |
||
133 | */ |
||
134 | public function isInvalidRecipient() |
||
144 | |||
145 | /** |
||
146 | * @return string |
||
147 | */ |
||
148 | public function __toString() |
||
152 | } |
||
153 |