1 | <?php namespace Scriptotek\Sru; |
||
8 | class Record |
||
9 | { |
||
10 | /** @var int */ |
||
11 | public $position; |
||
12 | |||
13 | /** @var string */ |
||
14 | public $packing; |
||
15 | |||
16 | /** @var string */ |
||
17 | public $schema; |
||
18 | |||
19 | /** @var QuiteSimpleXMLElement */ |
||
20 | public $data; |
||
21 | |||
22 | static $recordTpl = '<srw:record xmlns:srw="http://www.loc.gov/zing/srw/"> |
||
23 | <srw:recordSchema>{{recordSchema}}</srw:recordSchema> |
||
24 | <srw:recordPacking>{{recordPacking}}</srw:recordPacking> |
||
25 | <srw:recordPosition>{{position}}</srw:recordPosition> |
||
26 | <srw:recordData>{{data}}</srw:recordData> |
||
27 | </srw:record>'; |
||
28 | |||
29 | /** |
||
30 | * Create a new record |
||
31 | * @param QuiteSimpleXMLElement $doc |
||
32 | */ |
||
33 | public function __construct(QuiteSimpleXMLElement $doc) |
||
40 | |||
41 | /** |
||
42 | * @param int $position |
||
43 | * @param string|QuiteSimpleXMLElement $data |
||
44 | * @param string $recordSchema |
||
45 | * @param string $recordPacking |
||
46 | * @return Record |
||
47 | */ |
||
48 | public static function make($position, $data, $recordSchema='marcxchange', $recordPacking='xml') |
||
58 | } |
||
59 |