aboutsummaryrefslogtreecommitdiff
path: root/classes/BiblioIsisDb.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-06-07 17:48:34 -0300
committerSilvio <silvio@devlet.com.br>2010-06-07 17:48:34 -0300
commit0f3203c9c25b2c936ba8ebdf2fd2548209213620 (patch)
treec6f8b556bb81817304f24051a3bfd7abf751f1fd /classes/BiblioIsisDb.php
parentb3b87bf51fddd21130bf8975036ee82f66ad042b (diff)
downloadcinisis-0f3203c9c25b2c936ba8ebdf2fd2548209213620.tar.gz
cinisis-0f3203c9c25b2c936ba8ebdf2fd2548209213620.tar.bz2
Misc fixes
Diffstat (limited to 'classes/BiblioIsisDb.php')
-rw-r--r--classes/BiblioIsisDb.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/classes/BiblioIsisDb.php b/classes/BiblioIsisDb.php
index 6ae5827..36c0bbc 100644
--- a/classes/BiblioIsisDb.php
+++ b/classes/BiblioIsisDb.php
@@ -92,7 +92,9 @@ class BiblioIsisDb implements IsisDb {
$data = $this->tag($results);
// Charset conversion.
- array_walk_recursive($data, array(__CLASS__, 'charset'));
+ if (is_array($data)) {
+ array_walk_recursive($data, array(__CLASS__, 'charset'));
+ }
// Return the result.
return $data;
@@ -122,7 +124,7 @@ class BiblioIsisDb implements IsisDb {
*
* @see IsisDb::check()
*/
- public function check($schema, $section = NULL) {
+ static function check($schema, $section = NULL) {
// Check API availability.
if (!class_exists('Perl')) {
throw new Exception('Could not find Perl class. Please check your php-perl installation.');
@@ -144,11 +146,18 @@ class BiblioIsisDb implements IsisDb {
*
* @return
* Tagged database result.
+ *
+ * @todo
+ * Alternative handling for when $key is not set.
*/
function tag($results) {
foreach ($results as $key => $value) {
// Key '000' used to hold MFN.
if ($key != '000') {
+ if (!isset($this->format['fields'][$key])) {
+ return;
+ }
+
$name = $this->format['fields'][$key]['name'];
$data[$name] = $this->repetition($key, $value);