You are here

public function File::warnings in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/marcParse/php-marc.php \File::warnings()
  2. 6 marcParse/php-marc.php \File::warnings()
  3. 7.2 modules/marcParse/php-marc.php \File::warnings()

Get warning(s)

Get either all warnings or a specific warning ID.

Parameters

integer ID of the warning:

Return value

array|string Return either Array of all warnings or specific warning

File

modules/marcParse/php-marc.php, line 146
@package PHP-MARC

Class

File
Class File Class to read MARC records from file(s)

Code

public function warnings($id = "") {
  if (!$id) {
    return $this->warn;
  }
  else {
    if (array_key_exists($id, $this->warn)) {
      return $this->warn[$id];
    }
    else {
      return "Invalid warning ID: {$id}";
    }
  }
}