forked from MARCspec/php-marc-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMARCspecInterface.php
More file actions
executable file
·88 lines (80 loc) · 2.2 KB
/
MARCspecInterface.php
File metadata and controls
executable file
·88 lines (80 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
* MARCspec is the specification of a reference, encoded as string, to a set of data
* from within a MARC record.
*
* @author Carsten Klee <mailme.klee@yahoo.de>
* @copyright For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CK\MARCspec;
/**
* MARCspec subfield interface.
*/
interface MARCspecInterface
{
/**
* Constructor for a MARCspec.
*
* For a minimal MARCspec a field tag must be provided by default
*
* @api
*
* @param string|FieldInterface $spec The MARCspec as string or an instance of
* FieldInterface
*/
public function __construct($spec);
/**
* Set the field.
*
* @param FieldInterface $field Instance of FieldInterface
*
* @return MARCspec Instance of MARCspec
*/
public static function setField(FieldInterface $field);
/**
* Get the field.
*
* @return FieldInterface An instance of FieldInterface
*/
public function getField();
/**
* Add subfields.
*
* @param string|SubfieldInterface $subfields The subfield spec or instance of
* SubfieldInterface
*/
public function addSubfields($subfields);
/**
* Get array of subfields.
*
* @return null|array[SubfieldInterface] $subfields The array of instances of
* SubfieldInterface
*/
public function getSubfields();
/**
* Get array of subfields with a specific tag.
*
* @param string $subfieldTag The subfield tag
*
* @return null|array $subfields [SubfieldInterface] $subfields The array of
* instances of SubfieldInterface with a specific tag
*/
public function getSubfield($subfieldTag);
/**
* Encodes MARCspec as string.
*
* @api
*
* @return string The MARCspec as string
*/
public function __toString();
/**
* Serialize MARCspec as JSON.
*
* @api
*
* @return string The MARCspec as JSON encoded
*/
public function jsonSerialize();
} // EOI