aboutsummaryrefslogtreecommitdiff
path: root/classes/BiblioIsisDb.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-27 10:52:00 -0300
committerSilvio <silvio@devlet.com.br>2010-07-27 10:52:00 -0300
commit1c7744d7b0298723bcc2783663b60cd8a2c0e67b (patch)
tree0dfe210d998392cf3c0d789b109fff93573aa73b /classes/BiblioIsisDb.php
parent362ddf298200ee6a7dfcc535df48d22ee2478e9c (diff)
downloadcinisis-1c7744d7b0298723bcc2783663b60cd8a2c0e67b.tar.gz
cinisis-1c7744d7b0298723bcc2783663b60cd8a2c0e67b.tar.bz2
Moving join_subfields and main_field_name to CinisisDb
Diffstat (limited to 'classes/BiblioIsisDb.php')
-rw-r--r--classes/BiblioIsisDb.php43
1 files changed, 3 insertions, 40 deletions
diff --git a/classes/BiblioIsisDb.php b/classes/BiblioIsisDb.php
index eca03e5..2fb02cf 100644
--- a/classes/BiblioIsisDb.php
+++ b/classes/BiblioIsisDb.php
@@ -258,7 +258,7 @@ class BiblioIsisDb implements IsisDb {
}
else {
foreach ($name as $value) {
- $data[] = array($this->main_field_name($key) => $value);
+ $data[] = array(CinisisDb::main_field_name($this->format, $key) => $value);
}
}
@@ -333,10 +333,10 @@ class BiblioIsisDb implements IsisDb {
}
// Join subfields and main field if needed.
- if ($this->join_subfields()) {
+ if (CinisisDb::join_subfields($this->format)) {
$data[$entry] = $data[$entry]['subfields'];
if (isset($field)) {
- $data[$entry][$this->main_field_name($key)] = $field;
+ $data[$entry][CinisisDb::main_field_name($this->format, $key)] = $field;
}
}
}
@@ -345,43 +345,6 @@ class BiblioIsisDb implements IsisDb {
}
/**
- * Whether to join field and subfields in a single array.
- *
- * @return
- * Boolean.
- *
- * @todo
- * Should be added at IsisDb interface?
- */
- public function join_subfields() {
- if ($this->format['db']['join_subfields']) {
- return TRUE;
- }
-
- return FALSE;
- }
-
- /**
- * Determine the main field name depending on db configuration.
- *
- * @param $key
- * Field key.
- *
- * @return
- * Main field name, 'field' by default.
- *
- * @todo
- * Should be added at IsisDb interface?
- */
- public function main_field_name($key) {
- if ($this->join_subfields()) {
- return $this->format['fields'][$key]['name'];
- }
-
- return 'field';
- }
-
- /**
* Deals with repetition.
*
* As Biblio::Isis always return field values as arrays, we