Record::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php namespace Scriptotek\OaiPmh;
2
3
use Danmichaelo\QuiteSimpleXMLElement\QuiteSimpleXMLElement;
4
5
/**
6
 * Single record from a OAI-PMH response
7
 */
8
class Record
9
{
10
11
    /** @var string */
12
    public $identifier;
13
14
    /** @var string Date/timestamp of the record */
15
    public $datestamp;
16
17
    /** @var QuiteSimpleXMLElement */
18
    public $data;
19
20
    /**
21
     * Create a new record
22
     *
23
     * @param QuiteSimpleXMLElement $doc
24
     */
25
    public function __construct(QuiteSimpleXMLElement $doc)
26
    {
27
        $this->identifier = $doc->text('oai:header/oai:identifier');
28
        $this->datestamp = $doc->text('oai:header/oai:datestamp');
29
        $this->data = $doc->first('oai:metadata');
30
    }
31
}
32