From 1457718f111ea45705555439e6a732e293cc7bef Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 13 Jul 2010 18:29:23 -0300 Subject: Adding hasFieldSubfieldCondition() on IsisConnector --- classes/IsisConnector.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'classes/IsisConnector.php') 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; + } } -- cgit v1.2.3