Skip to content

Commit 7a1b9ea

Browse files
rudolfbykerdanmichaelo
authored andcommitted
Document the getField function and add the missing return.
1 parent c90cc80 commit 7a1b9ea

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Record.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,24 @@ public function getRecord()
7070
return $this->record;
7171
}
7272

73+
/**
74+
* Find and wrap the specified MARC field.
75+
*
76+
* @param string $spec
77+
* The tag name.
78+
* @param bool $pcre
79+
* If true, match as a regular expression.
80+
*
81+
* @return \Scriptotek\Marc\Fields\Field|null
82+
* A wrapped field, or NULL if not found.
83+
*/
7384
public function getField($spec = null, $pcre = null)
7485
{
7586
$q = $this->record->getField($spec, $pcre);
7687
if ($q) {
7788
return new Field($q);
7889
}
90+
return null;
7991
}
8092

8193
public function getFields($spec = null, $pcre = null)

0 commit comments

Comments
 (0)