Completed
Push — master ( 03cde8...21f90a )
by Paul
02:45
created

ItemInformationRequest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 17
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessageString() 0 9 1
1
<?php
2
3
namespace lordelph\SIP2\Request;
4
5
/**
6
 * ItemInformationRequest may be used to request item information. The ACS should respond with the Item Information
7
 * Response message.
8
 *
9
 * @method setInstitutionId(string $institutionId)
10
 * @method setItemIdentifier(string $itemIdentifier)
11
 * @method setTerminalPassword(string $terminalPassword)
12
 *
13
 * @licence    https://opensource.org/licenses/MIT
14
 * @copyright  John Wohlers <[email protected]>
15
 * @copyright  Paul Dixon <[email protected]>
16
 */
17
class ItemInformationRequest extends SIP2Request
18
{
19
    protected $var = [
20
        'InstitutionId' => [],
21
        'ItemIdentifier' => [],
22
        'TerminalPassword' => ['default' => ''],
23
    ];
24
25
    public function getMessageString($withSeq = true, $withCrc = true): string
26
    {
27
        $this->newMessage('17');
28
        $this->addFixedOption($this->datestamp(), 18);
29
        $this->addVarOption('AO', $this->getVariable('InstitutionId'));
30
        $this->addVarOption('AB', $this->getVariable('ItemIdentifier'));
31
        $this->addVarOption('AC', $this->getVariable('TerminalPassword'));
32
33
        return $this->returnMessage($withSeq, $withCrc);
34
    }
35
}
36