From 5862e52bb3535d1605dcf65ad3d289971d4049e2 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 5 Jul 2010 14:59:33 -0300 Subject: Adding IsisConnector::explodeSubfield() and IsisConnector::filterSubfield() --- classes/IsisConnector.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php index f0e64e9..ebbfe91 100644 --- a/classes/IsisConnector.php +++ b/classes/IsisConnector.php @@ -411,4 +411,42 @@ class IsisConnector { return $value; } + + /** + * Explode brackets for a given subfield, avoiding null entries. + * + * @param $field + * Field data. + * + * @param $subfield + * Subfield. + * + * @param $row + * Row number. + * + * @return + * Exploded subfield data. + */ + public function explodeSubfield($field, $subfield, $row) { + return array_filter($this->explodeValue($this->getSubfield($field, $subfield, $row))); + } + + /** + * Filter brackets for a given subfield, avoiding null entries. + * + * @param $field + * Field data. + * + * @param $subfield + * Subfield. + * + * @param $row + * Row number. + * + * @return + * Filterd subfield data. + */ + public function filterSubfield($field, $subfield, $row) { + return array_filter($this->filterBrackets($this->getSubfield($field, $subfield, $row))); + } } -- cgit v1.2.3