From 44e7ef315dc560cd0de34e2b680cc914ba160377 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 30 Jun 2010 18:30:22 -0300 Subject: Renaming IsisConnector methods, adding getSubfieldList() and getValues() --- classes/IsisConnector.php | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php index eeedeb7..237d139 100644 --- a/classes/IsisConnector.php +++ b/classes/IsisConnector.php @@ -47,7 +47,7 @@ class IsisConnector { * @return * Field data. */ - public function getFields($field) { + public function getValues($field) { if (isset($this->result[$field['name']])) { return $this->result[$field['name']]; } @@ -73,6 +73,23 @@ class IsisConnector { } } + /** + * Get all values of a given field. + * + * @param $field + * Field array. + * + * @return + * Field data. + */ + public function getFields($field) { + for ($n = 0; $n >= count($this->result[$field['name']]); $n++) { + $values[$n] = $this->getField($field, $n); + } + + return $values; + } + /** * Get the value of a given subfield. * @@ -94,13 +111,33 @@ class IsisConnector { } } + /** + * Get all values of a given subfield. + * + * @param $field + * Field array. + * + * @param $subfield + * Subfield name. + * + * @return + * Subfield data. + */ + public function getSubfields($field, $subfield) { + for ($n = 0; $n >= count($this->result[$field['name']]); $n++) { + $values[$n] = $this->getSubfield($field, $subfield, $n); + } + + return $values; + } + /** * Get the list of subfields from a given field. * * @param $field * Field array. */ - public function getSubfields($field) { + public function getSubfieldList($field) { if (isset($field['subfields'])) { return $field['subfields']; } -- cgit v1.2.3