|
eZ Publish
[trunk]
|
The class eZISBN13 handles ISBN-13 numbers. More...
Public Member Functions | |
| attribute ($value) | |
| attributes () | |
| extractISBNNumber ($isbnNr=false, &$error) | |
| eZISBN13 ($isbnNr=null, $separator= '-') | |
| formatedISBNValue ($isbnNr=false, &$error, $separator= '-') | |
| hasAttribute ($value) | |
| hasRangeData () | |
| validate ($isbnNr, &$error) | |
Public Attributes | |
| $CheckDigit | |
| $Prefix | |
| $PublicationElement | |
| $RegistrantElement | |
| $RegistrationGroup | |
| const | CHECK_LENGTH = 1 |
| const | LENGTH = 13 |
| const | PREFIX_978 = 978 |
| const | PREFIX_979 = 979 |
| const | PREFIX_LENGTH = 3 |
Private Member Functions | |
| validateISBN13Checksum ($isbnNr, &$error) | |
The class eZISBN13 handles ISBN-13 numbers.
The class is containing an ISBN-13 number and extracts the different groups based on the information stored in the different ranges for Registration group and Registration elements. The Publication element will get the space left available.
Definition at line 20 of file ezisbn13.php.
| eZISBN13::attribute | ( | $ | value | ) |
Fetch the attribute sent in $value.
| $value | is the name of the attribute that should be fetched. |
Definition at line 66 of file ezisbn13.php.
Contains a list of all attributes for this class.
Definition at line 54 of file ezisbn13.php.
Referenced by hasAttribute().
| eZISBN13::extractISBNNumber | ( | $ | isbnNr = false, |
| &$ | error | ||
| ) |
Extracts the ISBN-13 number and are setting the class variables for the different parts when the value is found. The class variables should be set as default false in the constructor.
| $isbnNr | is the ISBN-13 number. Should be 13 digits long and may contain space or hyphen as separator. |
| $error | is used to send back an error message that will be shown to the user if the ISBN number was not extracted correctly. |
Definition at line 225 of file ezisbn13.php.
Referenced by eZISBN13(), formatedISBNValue(), and validate().
| eZISBN13::eZISBN13 | ( | $ | isbnNr = null, |
| $ | separator = '-' |
||
| ) |
Constructor
| $isbnNr | is the ISBN-13 number. example is: 978-0-11-000222-4 |
| $separator | is the hyphen used in the ISBN number to make the ISBN number more visible. |
Definition at line 34 of file ezisbn13.php.
| eZISBN13::formatedISBNValue | ( | $ | isbnNr = false, |
| &$ | error, | ||
| $ | separator = '-' |
||
| ) |
Receives an ISBN number and place hyphen on the correct place in the number. If the placement is not found, an error message will be set and false
The different parts of the ISBN-13 number will be stored in separate class variables.
| $isbnNr | is the ISBN-13 number. Should be 13 digits long and may contain space or hyphen as separator. |
| $error | is used to send back an error message that will be shown to the user if the ISBN number was not extracted correctly. |
| $separator | is the separator used to make the ISBN number visible. Could be either a space or hyphen. |
Definition at line 138 of file ezisbn13.php.
| eZISBN13::hasAttribute | ( | $ | value | ) |
Check if the attribute set in the string $value exists.
| $value | is the attribute you want to see if exist. |
Definition at line 97 of file ezisbn13.php.
Check if any ISBN ranges exist.
Definition at line 106 of file ezisbn13.php.
Referenced by attribute().
| eZISBN13::validate | ( | $ | isbnNr, |
| &$ | error | ||
| ) |
Validates the ISBN-13 number $isbnNr.
| $isbnNr | A string containing the number without any dashes. |
| $error | is used to send back an error message that will be shown to the user if the ISBN number was not extracted correctly. |
true if it is valid. Definition at line 327 of file ezisbn13.php.
| eZISBN13::validateISBN13Checksum | ( | $ | isbnNr, |
| &$ | error | ||
| ) | [private] |
Validates the ISBN-13 number $isbnNr.
| $isbnNr | A string containing the number without any dashes. |
| $error | is used to send back an error message that will be shown to the user if the ISBN number validated. |
true if it is valid. Definition at line 345 of file ezisbn13.php.
Referenced by validate().
| eZISBN13::$CheckDigit |
Definition at line 395 of file ezisbn13.php.
| eZISBN13::$Prefix |
Definition at line 391 of file ezisbn13.php.
| eZISBN13::$PublicationElement |
Definition at line 394 of file ezisbn13.php.
| eZISBN13::$RegistrantElement |
Definition at line 393 of file ezisbn13.php.
| eZISBN13::$RegistrationGroup |
Definition at line 392 of file ezisbn13.php.
| const eZISBN13::CHECK_LENGTH = 1 |
Definition at line 23 of file ezisbn13.php.
Referenced by formatedISBNValue().
| const eZISBN13::LENGTH = 13 |
Definition at line 24 of file ezisbn13.php.
Referenced by validateISBN13Checksum().
| const eZISBN13::PREFIX_978 = 978 |
Definition at line 25 of file ezisbn13.php.
| const eZISBN13::PREFIX_979 = 979 |
Definition at line 26 of file ezisbn13.php.
| const eZISBN13::PREFIX_LENGTH = 3 |
Definition at line 22 of file ezisbn13.php.
Referenced by formatedISBNValue().