1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace lordelph\SIP2\Request; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* EndPatronSessionRequest will be sent when a patron has completed all of their transactions. The ACS may, upon |
7
|
|
|
* receipt of this command, close any open files or deallocate data structures pertaining to that patron. The ACS |
8
|
|
|
* should respond with an End Session Response message. |
9
|
|
|
* |
10
|
|
|
* @method setInstitutionId(string $institutionId) |
11
|
|
|
* @method setPatronIdentifier(string $patron) |
12
|
|
|
* @method setTerminalPassword(string $terminalPassword) |
13
|
|
|
* @method setPatronPassword(string $patronPassword) |
14
|
|
|
* |
15
|
|
|
* @licence https://opensource.org/licenses/MIT |
16
|
|
|
* @copyright John Wohlers <[email protected]> |
17
|
|
|
* @copyright Paul Dixon <[email protected]> |
18
|
|
|
*/ |
19
|
|
|
class EndPatronSessionRequest extends SIP2Request |
20
|
|
|
{ |
21
|
|
|
protected $var = [ |
22
|
|
|
'InstitutionId' => [], |
23
|
|
|
'PatronIdentifier' => [], |
24
|
|
|
'TerminalPassword' => ['default' => ''], |
25
|
|
|
'PatronPassword' => ['default' => ''], |
26
|
|
|
]; |
27
|
|
|
|
28
|
1 |
|
public function getMessageString($withSeq = true, $withCrc = true): string |
29
|
|
|
{ |
30
|
1 |
|
$this->newMessage('35'); |
31
|
1 |
|
$this->addFixedOption($this->datestamp(), 18); |
32
|
1 |
|
$this->addVarOption('AO', $this->getVariable('InstitutionId')); |
33
|
1 |
|
$this->addVarOption('AA', $this->getVariable('PatronIdentifier')); |
34
|
1 |
|
$this->addVarOption('AC', $this->getVariable('TerminalPassword'), true); |
35
|
1 |
|
$this->addVarOption('AD', $this->getVariable('PatronPassword'), true); |
36
|
|
|
|
37
|
1 |
|
return $this->returnMessage($withSeq, $withCrc); |
38
|
|
|
} |
39
|
|
|
} |
40
|
|
|
|