aboutsummaryrefslogtreecommitdiff
path: root/classes/BiblioIsisDb.php
diff options
context:
space:
mode:
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);