You are here

public function ISBNtest::valid_isbn in Biblio Advanced Import 6

Same name and namespace in other branches
  1. 7 lib/isbntest.class.php \ISBNtest::valid_isbn()

File

lib/isbntest.class.php, line 258

Class

ISBNtest

Code

public function valid_isbn($isbn = "") {
  if ($isbn != "") {

    // if we've been given an ISBN then use it
    $this
      ->set_isbn($isbn);
  }
  if (isset($this->gtin14) && $this
    ->valid_gtin14() == TRUE || isset($this->isbn13) && $this
    ->valid_isbn13() == TRUE || isset($this->isbn10) && $this
    ->valid_isbn10() == TRUE) {

    // in this routine, we don't care what kind it is, only that it's valid.
    return TRUE;
  }
  else {
    $this->error = "Checkdigit failure";
    return FALSE;
  }
}