diff options
author | Silvio <silvio@devlet.com.br> | 2010-07-01 14:30:21 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-07-01 14:30:21 -0300 |
commit | d5762ebb744f5b4873e6ad779d96b694c8f0839f (patch) | |
tree | 714fe335093f63fc095546d6d5e43471d436883c /classes/IsisConnector.php | |
parent | b9ef6604ea1d62a1e23bed37c5a3e96b8733da97 (diff) | |
download | cinisis-d5762ebb744f5b4873e6ad779d96b694c8f0839f.tar.gz cinisis-d5762ebb744f5b4873e6ad779d96b694c8f0839f.tar.bz2 |
Adding IsisConnector::getRows() and minor changes
Diffstat (limited to 'classes/IsisConnector.php')
-rw-r--r-- | classes/IsisConnector.php | 22 |
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(); } |