Client
extends DataObject
in package
A DataObject representation of Client (Klient)
Includes the tables
klient, personen, adressen
Tags
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 commidity 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
= []
$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 databasetype The DataType to instation for the respective valueprops are optional and every validator can implement their own$lifeValidate
private
bool
$lifeValidate
= false
Methods
__construct()
The constructor is normally called from one of the {@link \VeruA\DataMapper\DataMapper}s descendants
public
__construct([mixed $data = null ]) : mixed
Parameters
Return values
mixed —__get()
Returnes the {@link \VeruA\DataObjects\DataType} of the requested field
public
__get(string $name) : DataType
Parameters
- $name : string
-
The name of the field
Tags
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
Return values
mixed —__unset()
public
__unset(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —fullName()
A commidity function to get the full Clients name composed as `nname, vname`
public
fullName() : string
Tags
Return values
string —The full name
validate()
Validate the data array with the registered validators
public
validate() : bool
Tags
Return values
bool —Returns true if all fields are valid
values()
Returns the internal data Array, containing all the DataObjects
public
values() : mixed