aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-13 18:29:23 -0300
committerSilvio <silvio@devlet.com.br>2010-07-13 18:29:23 -0300
commit1457718f111ea45705555439e6a732e293cc7bef (patch)
tree9b74b105c0497f58229bd8b0a477749d2d14bb1f /classes
parente66cda93a6bb085aacf9ae90d74d7084378672b6 (diff)
downloadcinisis-1457718f111ea45705555439e6a732e293cc7bef.tar.gz
cinisis-1457718f111ea45705555439e6a732e293cc7bef.tar.bz2
Adding hasFieldSubfieldCondition() on IsisConnector
Diffstat (limited to 'classes')
-rw-r--r--classes/IsisConnector.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php
index 710048a..cc4bf62 100644
--- a/classes/IsisConnector.php
+++ b/classes/IsisConnector.php
@@ -514,4 +514,33 @@ class IsisConnector {
public function getSubfieldName($field_key, $subfield_key) {
return $this->format['fields'][$field_key]['subfields'][$subfield_key];
}
+
+ /**
+ * Check if a field and subfield match a given condition.
+ *
+ * @param $field
+ * Field data.
+ *
+ * @param $subfield
+ * Subfield.
+ *
+ * @param $key
+ * Field key.
+ *
+ * @param $subkey
+ * Subfield key.
+ *
+ * @return
+ * True if condition match, false otherwise.
+ */
+ public function hasFieldSubfieldCondition($field, $subfield, $key, $subkey) {
+ $field_key = $this->getFieldKey($field);
+ $subdield_key = $this->getSubfieldKey($field, $subfield);
+ if ($field_key == $key && $subfield_key == $subkey)
+ {
+ return true;
+ }
+
+ return false;
+ }
}