|
14 | 14 | class Record
|
15 | 15 | {
|
16 | 16 | protected $record;
|
17 |
| - protected $factory; |
18 | 17 |
|
19 | 18 | /**
|
20 | 19 | * Record constructor.
|
21 | 20 | * @param File_MARC_Record $record
|
22 |
| - * @param Factory|null $factory |
23 | 21 | */
|
24 |
| - public function __construct(File_MARC_Record $record, Factory $factory = null) |
| 22 | + public function __construct(File_MARC_Record $record) |
25 | 23 | {
|
26 | 24 | $this->record = $record;
|
27 |
| - $this->factory = $factory ?: new Factory(); |
28 | 25 | }
|
29 | 26 |
|
| 27 | + /************************************************************************* |
| 28 | + * Data loading |
| 29 | + *************************************************************************/ |
| 30 | + |
30 | 31 | /**
|
31 | 32 | * Returns the first record found in the file $filename, or null if no records found.
|
32 | 33 | *
|
@@ -62,7 +63,20 @@ public static function fromString($data)
|
62 | 63 | }
|
63 | 64 |
|
64 | 65 | /*************************************************************************
|
65 |
| - * Determine if record is a bibliographic, authority or holdings record |
| 66 | + * Query |
| 67 | + *************************************************************************/ |
| 68 | + |
| 69 | + /** |
| 70 | + * @param string $spec The MARCspec string |
| 71 | + * @return QueryResult |
| 72 | + */ |
| 73 | + public function query($spec) |
| 74 | + { |
| 75 | + return new QueryResult(new File_MARC_Reference($spec, $this->record)); |
| 76 | + } |
| 77 | + |
| 78 | + /************************************************************************* |
| 79 | + * Helper methods for LDR |
66 | 80 | *************************************************************************/
|
67 | 81 |
|
68 | 82 | /**
|
@@ -129,7 +143,7 @@ public function getCatalogingForm()
|
129 | 143 | /**
|
130 | 144 | * Get the value of the 001 field as a `ControlField` object.
|
131 | 145 | *
|
132 |
| - * @return Title |
| 146 | + * @return ControlField |
133 | 147 | */
|
134 | 148 | public function getId()
|
135 | 149 | {
|
@@ -178,20 +192,6 @@ public function getSubjects($vocabulary = null, $tag = null)
|
178 | 192 | * Support methods
|
179 | 193 | *************************************************************************/
|
180 | 194 |
|
181 |
| - protected function makeField($model, \File_MARC_Field $field) |
182 |
| - { |
183 |
| - return $this->factory->makeField($model, $field); |
184 |
| - } |
185 |
| - |
186 |
| - /** |
187 |
| - * @param string $spec The MARCspec string |
188 |
| - * @return QueryResult |
189 |
| - */ |
190 |
| - public function query($spec) |
191 |
| - { |
192 |
| - return new QueryResult(new File_MARC_Reference($spec, $this->record)); |
193 |
| - } |
194 |
| - |
195 | 195 | public function __call($name, $args)
|
196 | 196 | {
|
197 | 197 | return call_user_func_array(array($this->record, $name), $args);
|
|
0 commit comments