From b54991f7f2bbce1f15d2b5d561eeef92194e1700 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 11 Aug 2010 17:50:38 -0300 Subject: Fixing iterators' indexes --- classes/IsisConnector.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'classes/IsisConnector.php') diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php index 2b4fe28..e845683 100644 --- a/classes/IsisConnector.php +++ b/classes/IsisConnector.php @@ -103,7 +103,12 @@ class IsisConnector { * Number of rows. */ public function getRows($field) { - return count($this->result[$field['name']]); + if (isset($this->result[$field['name']])) { + return count($this->result[$field['name']]); + } + else { + return 0; + } } /** @@ -735,7 +740,11 @@ class IsisConnector { * Subfield name. */ public function getSubfieldName($field_key, $subfield_key) { - return $this->format['fields'][$field_key]['subfields'][$subfield_key]; + if (isset($this->format['fields'][$field_key]['subfields'][$subfield_key])) { + return $this->format['fields'][$field_key]['subfields'][$subfield_key]; + } + + return FALSE; } /** @@ -771,7 +780,7 @@ class IsisConnector { */ public function hasFieldSubfieldCondition($field, $subfield, $key, $subkey) { $field_key = $this->getFieldKey($field); - $subdield_key = $this->getSubfieldKey($field, $subfield); + $subfield_key = $this->getSubfieldKey($field, $subfield); if ($field_key == $key && $subfield_key == $subkey) { return true; -- cgit v1.2.3