|
1
|
|
|
<?php |
|
|
|
|
|
|
2
|
|
|
require_once("mod_isbn/ISBN.php"); |
|
3
|
|
|
|
|
4
|
|
|
|
|
5
|
|
|
class ISBN_For_PINP extends ISBN { |
|
6
|
|
|
|
|
7
|
|
|
function __construct($groups_csv, $isbn, $ver) { |
|
8
|
|
|
ISBN::ISBN($isbn, $ver); |
|
|
|
|
|
|
9
|
|
|
$this->groups_csv = $groups_csv; |
|
|
|
|
|
|
10
|
|
|
} |
|
11
|
|
|
|
|
12
|
|
|
function _convert($isbnin, $verfrom = ISBN_VERSION_ISBN_10, $verto = ISBN_VERSION_ISBN_13) { |
|
13
|
|
|
return $this->convert($isbnin, $verfrom, $verto); |
|
14
|
|
|
} |
|
15
|
|
|
|
|
16
|
|
|
function _getCheckdigit() { |
|
17
|
|
|
return $this->getCheckdigit(); |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
|
|
function _getEAN() { |
|
21
|
|
|
return $this->getEAN(); |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
function _getGroup() { |
|
25
|
|
|
return $this->getGroup(); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
function _getISBN() { |
|
29
|
|
|
return $this->getISBN(); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
function _getISBNDisplayable($format = '') { |
|
33
|
|
|
return $this->getISBNDisplayable($format); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
function _setISBN($isbn) { |
|
37
|
|
|
return $this->setISBN($isbn); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
function _getPublisher() { |
|
41
|
|
|
return $this->getPublisher(); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
function _getTitle() { |
|
45
|
|
|
return $this->getTitle(); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
function _isValid() { |
|
49
|
|
|
return $this->isValid(); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
function _validate($isbn, $ver = ISBN_DEFAULT_INPUTVERSION) { |
|
53
|
|
|
return $this->validate($isbn, $ver); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
function _getVersion() { |
|
57
|
|
|
return $this->getVersion(); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
function _guessVersion($isbn) { |
|
61
|
|
|
return $this->guessVersion($isbn); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
class pinp_ISBN { |
|
|
|
|
|
|
67
|
|
|
|
|
68
|
|
|
function _create($isbn = '', $ver = ISBN_DEFAULT_INPUTVERSION) { |
|
69
|
|
|
$groups_csv = $this->store->get_config("code")."modules/mod_isbn/data/groups.csv"; |
|
|
|
|
|
|
70
|
|
|
return new ISBN_For_PINP($groups_csv, $isbn, $ver); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
} |
|
74
|
|
|
|
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.