aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-08-19 10:51:05 -0300
committerSilvio <silvio@devlet.com.br>2010-08-19 10:51:05 -0300
commited250793255353582ae32d2cf5dc726004f3e0d8 (patch)
treeafad07967797ff05358c2f9845817683a550a8de /classes
parent70d0c6f95279f67f863cf6cb8e2a0528534c4519 (diff)
downloadcinisis-ed250793255353582ae32d2cf5dc726004f3e0d8.tar.gz
cinisis-ed250793255353582ae32d2cf5dc726004f3e0d8.tar.bz2
Using field array instead of field name at IsisFinder
Diffstat (limited to 'classes')
-rw-r--r--classes/IsisConnector.php17
-rw-r--r--classes/IsisFinder.php16
2 files changed, 25 insertions, 8 deletions
diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php
index 64a6c59..09bb8ea 100644
--- a/classes/IsisConnector.php
+++ b/classes/IsisConnector.php
@@ -448,6 +448,23 @@ class IsisConnector {
}
/**
+ * Get the array which defines a field.
+ *
+ * @param $field_key
+ * Field key.
+ *
+ * @return
+ * Field array.
+ */
+ public function getFieldArray($field_key) {
+ if (isset($this->format['fields'][$field_key])) {
+ return $this->format['fields'][$field_key];
+ }
+
+ return NULL;
+ }
+
+ /**
* Remove brackets from strings whithin an array.
*
* @param $value
diff --git a/classes/IsisFinder.php b/classes/IsisFinder.php
index 1f8ed0f..a87488f 100644
--- a/classes/IsisFinder.php
+++ b/classes/IsisFinder.php
@@ -11,7 +11,7 @@ class IsisFinder extends IsisConnector {
* Start entry number to begin the search.
*
* @param $field
- * Field name.
+ * Field data.
*
* @return
* Next repetition entry and result.
@@ -25,9 +25,9 @@ class IsisFinder extends IsisConnector {
if ($entry == $entries) {
break;
}
- } while (!isset($result[$field]) || count($result[$field]) < 2);
+ } while (!isset($result[$field['name']]) || count($result[$field['name']]) < 2);
- if (!isset($result[$field]) || count($result[$field]) < 2) {
+ if (!isset($result[$field['name']]) || count($result[$field['name']]) < 2) {
return FALSE;
}
@@ -41,7 +41,7 @@ class IsisFinder extends IsisConnector {
* Start entry number to begin the search.
*
* @param $field
- * Field name.
+ * Field data.
*
* @return
* Next occurrence.
@@ -55,9 +55,9 @@ class IsisFinder extends IsisConnector {
if ($entry == $entries) {
break;
}
- } while (!isset($result[$field]));
+ } while (!isset($result[$field['name']]));
- if (!isset($result[$field])) {
+ if (!isset($result[$field['name']])) {
return FALSE;
}
@@ -71,7 +71,7 @@ class IsisFinder extends IsisConnector {
* Start entry number to begin the search.
*
* @param $field
- * Field name.
+ * Field data.
*
* @param $subfield
* Subfield name.
@@ -94,7 +94,7 @@ class IsisFinder extends IsisConnector {
$has = $this->hasSubfieldInRows($field, $subfield);
} while ($has === FALSE);
- if (!isset($result[$field][$has][$subfield])) {
+ if (!$this->hasSubfield($field, $subfield, $has)) {
return FALSE;
}