Commit 99acd4a9 authored by David Maus's avatar David Maus
Browse files

New function: Return all subfields with specified code

* HAB/Pica/Record/Field.php (getSubfieldsWithCode): New
  function. Return all subfields with specified code.
parent 15f0f307
......@@ -262,6 +262,17 @@ class Field
return null;
}
/**
* Return all subfields with the specified code.
*
* @param string $code Subfield code
* @return array
*/
public function getSubfieldsWithCode ($code)
{
return array_filter($this->_subfields, function (Subfield $s) use ($code) { return $s->getCode() == $code; });
}
/**
* Return the field tag.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment