aboutsummaryrefslogtreecommitdiff
path: root/classes/IsisConnector.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-01 14:30:21 -0300
committerSilvio <silvio@devlet.com.br>2010-07-01 14:30:21 -0300
commitd5762ebb744f5b4873e6ad779d96b694c8f0839f (patch)
tree714fe335093f63fc095546d6d5e43471d436883c /classes/IsisConnector.php
parentb9ef6604ea1d62a1e23bed37c5a3e96b8733da97 (diff)
downloadcinisis-d5762ebb744f5b4873e6ad779d96b694c8f0839f.tar.gz
cinisis-d5762ebb744f5b4873e6ad779d96b694c8f0839f.tar.bz2
Adding IsisConnector::getRows() and minor changes
Diffstat (limited to 'classes/IsisConnector.php')
-rw-r--r--classes/IsisConnector.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php
index 237d139..071736b 100644
--- a/classes/IsisConnector.php
+++ b/classes/IsisConnector.php
@@ -56,6 +56,19 @@ class IsisConnector {
}
/**
+ * Get the number of resulting rows for a given field.
+ *
+ * @param $field
+ * Field array.
+ *
+ * @return
+ * Number of rows.
+ */
+ public function getRows($field) {
+ return count($this->result[$field['name']]);
+ }
+
+ /**
* Get the value of a given field.
*
* @param $field
@@ -83,8 +96,8 @@ class IsisConnector {
* Field data.
*/
public function getFields($field) {
- for ($n = 0; $n >= count($this->result[$field['name']]); $n++) {
- $values[$n] = $this->getField($field, $n);
+ for ($row = 0; $row >= $this->getRows($field); $row++) {
+ $values[$row] = $this->getField($field, $row);
}
return $values;
@@ -124,8 +137,8 @@ class IsisConnector {
* Subfield data.
*/
public function getSubfields($field, $subfield) {
- for ($n = 0; $n >= count($this->result[$field['name']]); $n++) {
- $values[$n] = $this->getSubfield($field, $subfield, $n);
+ for ($row = 0; $row >= $this->getRows($field); $row++) {
+ $values[$row] = $this->getSubfield($field, $subfield, $row);
}
return $values;
@@ -141,6 +154,7 @@ class IsisConnector {
if (isset($field['subfields'])) {
return $field['subfields'];
}
+
return array();
}