aboutsummaryrefslogtreecommitdiff
path: root/classes/IsisConnector.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-15 18:07:01 -0300
committerSilvio <silvio@devlet.com.br>2010-07-15 18:07:01 -0300
commitd83a35ce8486256ff865596066c6dbf23bfe5b18 (patch)
treeadbee4754fedb9f981d9a155974854311906f823 /classes/IsisConnector.php
parent1457718f111ea45705555439e6a732e293cc7bef (diff)
downloadcinisis-d83a35ce8486256ff865596066c6dbf23bfe5b18.tar.gz
cinisis-d83a35ce8486256ff865596066c6dbf23bfe5b18.tar.bz2
Adding IsisNormalSubfieldFilterIterator
Diffstat (limited to 'classes/IsisConnector.php')
-rw-r--r--classes/IsisConnector.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php
index cc4bf62..c731d9a 100644
--- a/classes/IsisConnector.php
+++ b/classes/IsisConnector.php
@@ -543,4 +543,43 @@ class IsisConnector {
return false;
}
+
+ /**
+ * Deal with special subfields.
+ *
+ * @param $field
+ * Field data from ISIS database schema.
+ *
+ * @param $subfield
+ * Subfield name.
+ *
+ * @param $return
+ * Specify return type.
+ *
+ * @return
+ * True if special subfield, false otherwise of special return type
+ */
+ public function specialSubfield($field, $subfield, $return = 'boolean') {
+ if (isset($field['special'])) {
+ $field_key = $this->getFieldKey($field);
+ $subfield_key = $this->getSubfieldKey($field, $subfield);
+ $name = $field['name'] .':'. $subfield;
+ $code = $field_key .':'. $subfield_key;
+
+ if (array_search($subfield_key, $field['special'])) {
+ $this->log("Found special subfield $name", 'debug');
+
+ if ($return == 'boolean') {
+ return true;
+ }
+ elseif ($return == 'code') {
+ return $code;
+ }
+
+ return $name;
+ }
+ }
+
+ return false;
+ }
}