ISBN
[ class tree: ISBN ] [ index: ISBN ] [ all elements ]

Class: ISBN

Source Location: /ISBN.php

Class Overview


ISBN class


Author(s):

Copyright:

  • 2006-2007 Tom Klingenberg

Methods



Class Details

[line 115]
ISBN class

Class to Handle, Convert and Validate ISBN Numbers




Tags:

since:  Class available since Release 0.0.0
link:  http://isbn.lastflood.com/
license:  LGPL
copyright:  2006-2007 Tom Klingenberg
author:  Tom Klingenberg <tkli-php@lastflood.net>


[ Top ]


Class Methods


static method convert [line 1028]

static string|false convert( string $isbnin, [integer $verfrom = ISBN_VERSION_ISBN_10], [integer $verto = ISBN_VERSION_ISBN_13])

converts an ISBN number from one version to another can convert ISBN-10 to ISBN-13 and ISBN-13 to ISBN-10



Tags:

return:  converted ISBN Number or false if conversion failed
access:  public


Parameters:

string   $isbnin   ISBN to convert, must be a valid ISBN Number
integer   $verfrom   version value of the input ISBN
integer   $verto   version value to convert to

[ Top ]

static method guessVersion [line 1537]

static integer|false guessVersion( string $isbn)

Guesses ISBN version of passed string

Note: This is not Validation. To get the validated version of an ISBN Number use self::validate();




Tags:

return:  Version Value or false if failed
access:  public
see:  validate();


Parameters:

string   $isbn   ISBN Number to guess Version of

[ Top ]

static method validate [line 1492]

static integer|false validate( string $isbn, [integer $ver = ISBN_DEFAULT_INPUTVERSION])

Validates an ISBN



Tags:

return:  Version value of a valid ISBN or false if it did not validate
access:  public


Parameters:

string   $isbn   ISBN to validate
integer   $ver   ISBN-Version to validate against

[ Top ]

constructor __construct [line 152]

ISBN __construct( [array $isbn = ''], [mixed $ver = ISBN_DEFAULT_INPUTVERSION])

Constructor



Tags:

throws:  ISBN_Exception in case it fails
access:  public


Parameters:

array   $isbn   String of ISBN Value to use
mixed   $ver   Optional Version Constant

[ Top ]

method getCheckdigit [line 1077]

string|false getCheckdigit( )

Get the Checkdigit Part of ISBN Number



Tags:

return:  Checkdigit or false if failed
access:  public


[ Top ]

method getEAN [line 1103]

string|false getEAN( )

Get the EAN Prefix of ISBN Number (ISBN-13)



Tags:

return:  EAN Prefix or false if failed
access:  public


[ Top ]

method getGroup [line 1125]

string|false getGroup( )

Get the Registrationgroup Part of the ISBN Number



Tags:

return:  Group Identifier or false if failed
access:  public


[ Top ]

method getISBN [line 1168]

string getISBN( )

Get whole ISBN Number



Tags:

return:  ISBN Number (unformatted); empty string if this is not a valid ISBN
access:  public


[ Top ]

method getISBNDisplayable [line 1214]

string getISBNDisplayable( [string $format = ''])

Get whole ISBN Number in a displayable fashion (see Handbook p. 15)



Tags:

return:  ISBN Number (formatted); empty string if this is not a valid ISBN
access:  public


Parameters:

string   $format   Formatstring 1-4 Chars: each character is a control char: #1 i or not: use international pre-prefix #2 i or not: "ISBN" in front or v: incl. version #3 : or not: insert a ":" #4 - or not: use - after EAN (ISBN 13 only) #4 or =: use - between each ISBN part Example 1: ' --' 978-0-385-33941-4 classic displayable ISBN Example 2: ' v:-' ISBN-13: 978-0385339414 ISBN-Format used by amazon Example 3: 'iv:=' ISBN-13: 978-0-385-33941-4 full blown: more is more!

[ Top ]

method getPublisher [line 1450]

string|false getPublisher( )

Get the Publication Part of the ISBN Number



Tags:

return:  Publisher or false if failed
access:  public


[ Top ]

method getTitle [line 1462]

string|false getTitle( )

Get the Title Part of the ISBN Number



Tags:

return:  Title or false if failed
access:  public


[ Top ]

method getVersion [line 1518]

integer|false getVersion( )

Returns version of this objects ISBN



Tags:

return:  Version value or ISBN_VERSION_NONE
access:  public


[ Top ]

method isValid [line 1475]

boolean isValid( )

Returns this ISBN validity



Tags:

access:  public


[ Top ]

method setISBN [line 1292]

void setISBN( string $isbn)

Setter for ISBN



Tags:

access:  public
throws:  ISBN_Exception in case it fails


Parameters:

string   $isbn   ISBN Number this is a valid ISBN Number or it is an Empty string which will reset the class

[ Top ]


Documentation generated on Tue, 06 Mar 2007 01:03:06 +0100 by phpDocumentor 1.3.1