From 6e905e2cb1034cca7f72575d4e7730076986b8b1 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 14 Jun 2010 15:15:32 -0300 Subject: Uniformizing BiblioIsis output --- classes/BiblioIsisDb.php | 21 +++++++++++---------- schemas/fbe.yaml | 3 ++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/classes/BiblioIsisDb.php b/classes/BiblioIsisDb.php index 36648aa..75d9b92 100644 --- a/classes/BiblioIsisDb.php +++ b/classes/BiblioIsisDb.php @@ -256,8 +256,13 @@ class BiblioIsisDb implements IsisDb { $method = 'subfields_from_'. $method; return $this->{$method}($name, $key); } + else { + foreach ($name as $value) { + $data[] = array('field' => $value); + } + } - return $name; + return $data; } /** @@ -332,7 +337,7 @@ class BiblioIsisDb implements IsisDb { * Deals with repetition. * * As Biblio::Isis always return field values as arrays, we - * have to check the database schema to see if we have to + * have to check the database schema to see if we want to * convert then to a single value. * * @param $field @@ -357,8 +362,9 @@ class BiblioIsisDb implements IsisDb { * Deals with repetition. * * As Biblio::Isis always return field values as arrays, we - * have to check the database schema to see if we have to - * convert then to a single value. + * have to check the database schema to see if we want to + * convert then to a single value. The current implementation + * is just a placeholder as no conversion is done. * * @param $field * Database field. @@ -370,12 +376,7 @@ class BiblioIsisDb implements IsisDb { * The value according to the repetition config. */ function repetition($key, $value) { - if ($this->is_repetitive($key, $value)) { - return $value; - } - else { - return $value[0]; - } + return $value; } /** diff --git a/schemas/fbe.yaml b/schemas/fbe.yaml index 7b26380..e0041fa 100644 --- a/schemas/fbe.yaml +++ b/schemas/fbe.yaml @@ -44,7 +44,8 @@ fields: b: título atribuído x: título ainda não confirmado map: - field: title + subfields: + a: title 22: name: Outros títulos repeat: Yes -- cgit v1.2.3