Documentation

Client extends DataObject
in package

A DataObject representation of Client (Klient)

Includes the tables

klient, personen, adressen

Tags
uses
DataType
uses
AHV

Table of Contents

$data  : array<string|int, DataType>
$dataTypes  : array<string|int, mixed>
This has to be overwritten by the concrete implementation.
$lifeValidate  : bool
__construct()  : mixed
The constructor is normally called from one of the {@link \VeruA\DataMapper\DataMapper}s descendants
__get()  : DataType
Returnes the {@link \VeruA\DataObjects\DataType} of the requested field
__isset()  : mixed
__set()  : mixed
Sets a value instatiating a new DataType Object if none is set, or sets the value of the DataType
__unset()  : mixed
fullName()  : string
A commoidity function to get the full Clients name composed as `nname, vname`
validate()  : bool
Validate the data array with the registered validators
values()  : mixed
Returns the internal data Array, containing all the DataObjects

Properties

$data

protected array<string|int, DataType> $data = []

Contains the DataTypes with their respetive values

$dataTypes

This has to be overwritten by the concrete implementation.

protected array<string|int, mixed> $dataTypes = [ // {{{ // klient 'id' => ['type' => 'Integer'], 'id_pers' => ['type' => 'Integer'], 'id_vers' => ['type' => 'Integer'], 'id_vers_zv' => ['type' => 'Integer'], 'id_vers_iv' => ['type' => 'Integer'], 'id_kanton' => ['type' => 'Integer'], 'id_kanton_iv_klv' => ['type' => 'Integer'], 'id_region' => ['type' => 'Integer'], 'geb' => ['type' => 'Date', 'props' => ['required' => true]], 'ahv' => ['type' => 'AHV', 'props' => ['required' => true, 'len' => 13, 'unique' => true]], 'vers_nr' => ['type' => 'DataType'], 'vers_nr_zv' => ['type' => 'DataType'], 'vers_nr_iv' => ['type' => 'DataType'], 'card_id' => ['type' => 'DataType'], 'expiry_date' => ['type' => 'Date'], 'bemerkung' => ['type' => 'DataType'], 'anfang' => ['type' => 'Date'], 'del' => ['type' => 'Boolean'], 'arbeitgeber' => ['type' => 'DataType'], 'plz_a' => ['type' => 'DataType'], 'ort_a' => ['type' => 'DataType'], 'ea_befreit' => ['type' => 'DataType'], 'id_kostentraeger' => ['type' => 'DataType'], 'id_rechempfaenger' => ['type' => 'DataType'], 'abrech_kv' => ['type' => 'DataType'], 'lbt' => ['type' => 'DataType'], 'zivilstand' => ['type' => 'DataType'], 'hh_typ' => ['type' => 'DataType'], 'anz_kinder' => ['type' => 'DataType'], 'hv_owner' => ['type' => 'DataType'], 'min_gewicht' => ['type' => 'DataType'], 'max_gewicht' => ['type' => 'DataType'], 'limit_s_bd' => ['type' => 'DataType'], 'limit_d_bd' => ['type' => 'DataType'], 'staatsang' => ['type' => 'DataType', 'props' => ['required' => true, 'len' => 2]], // personen 'anrede' => ['type' => 'DataType', 'props' => ['required' => true]], 'titel' => ['type' => 'DataType'], 'vname' => ['type' => 'DataType', 'props' => ['required' => true]], 'nname' => ['type' => 'DataType', 'props' => ['required' => true]], 'zusatz' => ['type' => 'DataType'], 'bemerkung' => ['type' => 'DataType'], 'id_adr' => ['type' => 'Integer'], // adressen 'str' => ['type' => 'DataType', 'props' => ['required' => true]], 'plz' => ['type' => 'DataType', 'props' => ['required' => true]], 'ort' => ['type' => 'DataType', 'props' => ['required' => true]], 'tel' => ['type' => 'DataType'], 'natel' => ['type' => 'DataType'], 'tel_geschaeft' => ['type' => 'DataType'], 'fax' => ['type' => 'DataType'], 'email' => ['type' => 'DataType'], 'webseite' => ['type' => 'DataType'], 'pfach' => ['type' => 'DataType'], 'gemeinde_nr_bfs' => ['type' => 'DataType'], 'kantons_nr_bfs' => ['type' => 'DataType'], ]

The format of the array is as follws:

column => [ 'type' => DataType, 'props' => ['required' => bool, 'len' => int] ], ...
  • column The column from the database
  • type The DataType to instation for the respective value
  • props are optional and every validator can implement their own
  • Need to be configured in the descendants. This is the actual configuration of the fields DataTypes

    $lifeValidate

    private bool $lifeValidate = false

    If set to true every value is validated on __set()

    Methods

    __construct()

    The constructor is normally called from one of the {@link \VeruA\DataMapper\DataMapper}s descendants

    public __construct([array<string|int, mixed> $data = null ]) : mixed
    Parameters
    $data : array<string|int, mixed> = null

    Sets the values of the DataObject. Every value is passed to the respective

    Return values
    mixed

    __get()

    Returnes the {@link \VeruA\DataObjects\DataType} of the requested field

    public __get(mixed $name) : DataType
    Parameters
    $name : mixed

    The name of the field

    Return values
    DataType

    Returns the DataType of the field

    __isset()

    public __isset(mixed $name) : mixed
    Parameters
    $name : mixed
    Return values
    mixed

    __set()

    Sets a value instatiating a new DataType Object if none is set, or sets the value of the DataType

    public __set(string $name, mixed $value) : mixed
    Parameters
    $name : string

    The name of the field

    $value : mixed

    The value

    Tags
    throws
    OutOfRangeException

    if the field does not exist

    Return values
    mixed

    __unset()

    public __unset(mixed $name) : mixed
    Parameters
    $name : mixed
    Return values
    mixed

    fullName()

    A commoidity function to get the full Clients name composed as `nname, vname`

    public fullName() : string
    Tags
    todo

    add a parameter to customize the formatting/composition

    Return values
    string

    The full name

    validate()

    Validate the data array with the registered validators

    public validate() : bool
    Tags
    throws
    ValidationException

    if the validation does not pass a validator containing all errors encountered

    Return values
    bool

    Returns true if all fields are valid

    values()

    Returns the internal data Array, containing all the DataObjects

    public values() : mixed
    Return values
    mixed

    Search results