Issn
extends AbstractAdapter
in package
Table of Contents
Properties
- $options : array<string|int, mixed>
- Allowed options for this adapter
Methods
- __construct() : mixed
- Constructor for this barcode adapter
- getCharacters() : int|string|array<string|int, mixed>
- Returns the allowed characters
- getChecksum() : string
- Returns the checksum function name
- getLength() : int|array<string|int, mixed>
- Returns the allowed barcode length
- hasValidCharacters() : bool
- Allows X on length of 8 chars
- hasValidChecksum() : bool
- Validates the checksum
- hasValidLength() : bool
- Checks the length of a barcode
- useChecksum() : AbstractAdapter|bool
- Sets the checksum validation, if no value is given, the actual setting is returned
- code25() : bool
- Validates the checksum (Modulo 10) CODE25 implementation factor 3
- gtin() : bool
- Validates the checksum (Modulo 10) GTIN implementation factor 3
- identcode() : bool
- Validates the checksum (Modulo 10) IDENTCODE implementation factors 9 and 4
- issn() : bool
- Validates the checksum () ISSN implementation (reversed mod11)
- postnet() : bool
- Validates the checksum () POSTNET implementation
- setCharacters() : $this
- Sets the allowed characters of this barcode
- setChecksum() : $this
- Sets the checksum validation method
- setLength() : $this
- Sets the length of this barcode
Properties
$options
Allowed options for this adapter
protected
array<string|int, mixed>
$options
= [
'length' => null,
// Allowed barcode lengths, integer, array, string
'characters' => null,
// Allowed barcode characters
'checksum' => null,
// Callback to checksum function
'useChecksum' => true,
]
Methods
__construct()
Constructor for this barcode adapter
public
__construct() : mixed
getCharacters()
Returns the allowed characters
public
getCharacters() : int|string|array<string|int, mixed>
Return values
int|string|array<string|int, mixed>getChecksum()
Returns the checksum function name
public
getChecksum() : string
Return values
stringgetLength()
Returns the allowed barcode length
public
getLength() : int|array<string|int, mixed>
Return values
int|array<string|int, mixed>hasValidCharacters()
Allows X on length of 8 chars
public
hasValidCharacters(string $value) : bool
Parameters
- $value : string
-
The barcode to check for allowed characters
Return values
boolhasValidChecksum()
Validates the checksum
public
hasValidChecksum(string $value) : bool
Parameters
- $value : string
-
The barcode to check the checksum for
Return values
boolhasValidLength()
Checks the length of a barcode
public
hasValidLength(string $value) : bool
Parameters
- $value : string
-
The barcode to check for proper length
Return values
booluseChecksum()
Sets the checksum validation, if no value is given, the actual setting is returned
public
useChecksum([bool $check = null ]) : AbstractAdapter|bool
Parameters
- $check : bool = null
Return values
AbstractAdapter|boolcode25()
Validates the checksum (Modulo 10) CODE25 implementation factor 3
protected
code25(string $value) : bool
Parameters
- $value : string
-
The barcode to validate
Return values
boolgtin()
Validates the checksum (Modulo 10) GTIN implementation factor 3
protected
gtin(string $value) : bool
Parameters
- $value : string
-
The barcode to validate
Return values
boolidentcode()
Validates the checksum (Modulo 10) IDENTCODE implementation factors 9 and 4
protected
identcode(string $value) : bool
Parameters
- $value : string
-
The barcode to validate
Return values
boolissn()
Validates the checksum () ISSN implementation (reversed mod11)
protected
issn(string $value) : bool
Parameters
- $value : string
-
The barcode to validate
Return values
boolpostnet()
Validates the checksum () POSTNET implementation
protected
postnet(string $value) : bool
Parameters
- $value : string
-
The barcode to validate
Return values
boolsetCharacters()
Sets the allowed characters of this barcode
protected
setCharacters(int $characters) : $this
Parameters
- $characters : int
Return values
$thissetChecksum()
Sets the checksum validation method
protected
setChecksum(callable $checksum) : $this
Parameters
- $checksum : callable
-
Checksum method to call
Return values
$thissetLength()
Sets the length of this barcode
protected
setLength(int|array<string|int, mixed> $length) : $this
Parameters
- $length : int|array<string|int, mixed>