|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace lordelph\SIP2\Response; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class RenewAllResponse provides the response from a RenewAllRequest |
|
7
|
|
|
* |
|
8
|
|
|
* @method getOk() |
|
9
|
|
|
* @method getRenewed() |
|
10
|
|
|
* @method getUnrenewed() |
|
11
|
|
|
* @method getTransactionDate() |
|
12
|
|
|
* @method getInstitutionId() |
|
13
|
|
|
* @method getRenewedItems() |
|
14
|
|
|
* @method getUnrenewedItems() |
|
15
|
|
|
* @method getScreenMessage() |
|
16
|
|
|
* @method getPrintLine() |
|
17
|
|
|
* @method getSequenceNumber() |
|
18
|
|
|
* |
|
19
|
|
|
* @licence https://opensource.org/licenses/MIT |
|
20
|
|
|
* @copyright John Wohlers <[email protected]> |
|
21
|
|
|
* @copyright Paul Dixon <[email protected]> |
|
22
|
|
|
*/ |
|
23
|
|
|
class RenewAllResponse extends SIP2Response |
|
24
|
|
|
{ |
|
25
|
|
|
//fixed part of response contains these |
|
26
|
|
|
protected $var = [ |
|
27
|
|
|
'Ok' => [], |
|
28
|
|
|
'Renewed' => [], |
|
29
|
|
|
'Unrenewed' => [], |
|
30
|
|
|
'TransactionDate' => [] |
|
31
|
|
|
]; |
|
32
|
|
|
|
|
33
|
|
|
//variable part of the response allowed to contain these... |
|
34
|
|
|
protected $allowedVariables=[ |
|
35
|
|
|
self::AO_INSTITUTION_ID, |
|
36
|
|
|
self::BM_RENEWED_ITEMS, |
|
37
|
|
|
self::BN_UNRENEWED_ITEMS, |
|
38
|
|
|
self::AF_SCREEN_MESSAGE, |
|
39
|
|
|
self::AG_PRINT_LINE, |
|
40
|
|
|
self::AY_SEQUENCE_NUMBER |
|
41
|
|
|
]; |
|
42
|
|
|
|
|
43
|
1 |
|
public function __construct($raw) |
|
44
|
|
|
{ |
|
45
|
1 |
|
$this->setVariable('Ok', substr($raw, 2, 1)); |
|
46
|
1 |
|
$this->setVariable('Renewed', substr($raw, 3, 4)); |
|
47
|
1 |
|
$this->setVariable('Unrenewed', substr($raw, 7, 4)); |
|
48
|
1 |
|
$this->setVariable('TransactionDate', substr($raw, 11, 18)); |
|
49
|
1 |
|
$this->parseVariableData($raw, 29); |
|
50
|
1 |
|
} |
|
51
|
|
|
} |
|
52
|
|
|
|