You are here

public function ISBNtest::get_isbn13 in Biblio Advanced Import 7

Same name and namespace in other branches
  1. 6 lib/isbntest.class.php \ISBNtest::get_isbn13()
1 call to ISBNtest::get_isbn13()
ISBNtest::valid_isbn13 in lib/isbntest.class.php

File

lib/isbntest.class.php, line 308

Class

ISBNtest

Code

public function get_isbn13() {
  if ($this->isbn13 != FALSE) {
    return $this->isbn13;
  }
  elseif ($this
    ->valid_isbn10() != FALSE) {
    $this
      ->set_isbn13("978" . substr($this->isbn10, 0, 9) . "0");

    // invalid ISBN used as a temp value for next step
    $checkdigit = (string) $this
      ->get_isbn13_checkdigit();
    $this
      ->set_isbn13("978" . substr($this->isbn10, 0, 9) . $checkdigit);

    // true value (I hope)
    return $this->isbn13;
  }
  else {
    $this->error = "No ISBN-10 value set or calculable";
    return FALSE;
  }
}