ISMN

ISMN Class

This class provides ISMN validation and conversion functionality.

category

VuFind

package

Code

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Page

Methods

Constructor

__construct(string $raw) 

Arguments

$raw

string

Raw ISMN string to convert/validate.

Get the ISMN in ISMN-10 format:

get10() : mixed

Response

mixed

ISMN, or false if invalid/incompatible.

Get the ISMN in ISMN-13 format:

get13() : mixed

Response

mixed

ISMN, or false if invalid/incompatible.

Given the first 9 digits of an ISMN-10, generate the check digit.

getISMN10CheckDigit(string $ismn) : string
static

Arguments

$ismn

string

The first 9 digits of an ISMN-10.

Response

string

The check digit.

Given the first 12 digits of an ISMN-13, generate the check digit.

getISMN13CheckDigit(string $ismn) : string
static

Arguments

$ismn

string

The first 12 digits of an ISMN-13.

Response

string

The check digit.

Is the current ISMN valid in some format? (May be 10 or 13 digit).

isValid() : boolean

Response

boolean

Is the provided ISMN-10 valid?

isValidISMN10(string $ismn) : boolean
static

Arguments

$ismn

string

The ISMN-10 to test.

Response

boolean

Is the provided ISMN-13 valid?

isValidISMN13(string $ismn) : boolean
static

Arguments

$ismn

string

The ISMN-13 to test.

Response

boolean

Return the first sequence of at least 9 digits preceded by an optional M.

normalizeISMN(string $raw) : string
static

These ISMN characters may be separated by any number of '.', '-', '_' and whitespace characters; the separation characters are removed. A lower m is converted to an upper M.

Arguments

$raw

string

ISMN to clean up.

Response

string

Normalized ISMN.

Properties

Raw ISMN string

raw : string
var

Type(s)

string

Validation status of ISMN (null until checked)

valid : boolean
var

Type(s)

boolean