Documentation

AHV extends DataType
in package

An implementation of AHV

Tags
todo

rename to EAN and extend to use for arbitrary EAN encoded values

Table of Contents

$validators  : array<string|int, callable>
$value  : mixed
__construct()  : mixed
adds an AHV validator
__toString()  : string
Make sure to overwrite this method in the implementations
equals()  : mixed
Compares the AHV-Numbers internal value
in()  : mixed
Converts the $value stripping of all dots
out()  : mixed
returns the value with the AHV typical dots on the correct places
raw()  : mixed
Returns the value without processing it
validate()  : true
Runs all registered validators
value()  : mixed
Returns the internal value

Properties

$validators

protected array<string|int, callable> $validators = []

An array of functions that are executed on validation

$value

protected mixed $value

The internal value of the DataType

Methods

__construct()

adds an AHV validator

public __construct([mixed $value = null ][, mixed $props = [] ]) : mixed
Parameters
$value : mixed = null
$props : mixed = []

The properties for the standard validators

Tags
todo

generalize for EAN encoded values

Return values
mixed

__toString()

Make sure to overwrite this method in the implementations

public __toString() : string
Return values
string

The value as is

equals()

Compares the AHV-Numbers internal value

public equals(AHV|string $compare) : mixed
Parameters
$compare : AHV|string

the AHV Number to be compared with the datatypes one

Return values
mixed

in()

Converts the $value stripping of all dots

public in(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

out()

returns the value with the AHV typical dots on the correct places

public out() : mixed
Return values
mixed

raw()

Returns the value without processing it

public raw() : mixed
Tags
deprecated

use value()

Return values
mixed

validate()

Runs all registered validators

public validate() : true
Tags
throws
ValidatorException
Return values
true

if validations was succsessful

value()

Returns the internal value

public value() : mixed
Return values
mixed

Search results