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