aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-05 14:59:33 -0300
committerSilvio <silvio@devlet.com.br>2010-07-05 14:59:33 -0300
commit5862e52bb3535d1605dcf65ad3d289971d4049e2 (patch)
tree15f344cbb259cb0f92d4260f6eb24faa97beda63
parent36bbcd8d22d139159018b59a5ef4b004dba031da (diff)
downloadcinisis-5862e52bb3535d1605dcf65ad3d289971d4049e2.tar.gz
cinisis-5862e52bb3535d1605dcf65ad3d289971d4049e2.tar.bz2
Adding IsisConnector::explodeSubfield() and IsisConnector::filterSubfield()
-rw-r--r--classes/IsisConnector.php38
1 files changed, 38 insertions, 0 deletions
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)));
+ }
}