Documentation

ClientMapper extends DataMapper
in package

The DataMapper is used to retrieve and store DataObjects from and to the Database

A DataMapper implementation has to provide the methods for interaction
But There should be find(ByXYZ) methods to retreive \VeruA\DataObjects and insert/update methods to store the data to the Database

Table of Contents

COLUMNS  = ['klient' => ['id', 'id_pers', 'ahv', 'geb', 'staatsang'], 'personen' => ['id_adr', 'vname', 'nname', 'anrede'], 'adressen' => ['str', 'plz', 'ort', 'tel', 'natel', 'email']]
JOINS  = ['LEFT JOIN personen ON id_pers=personen.id ', 'LEFT JOIN adressen ON personen.id_adr=adressen.id ']
TABLE  = 'klient'
WHERE  = ['klient.del=0']
$dbc  : mixed
$findStatement  : mixed
__construct()  : mixed
find()  : mixed
findByAHV()  : mixed
sqlColumns()  : mixed
sqlSelectQuery()  : mixed

Constants

COLUMNS

public mixed COLUMNS = ['klient' => ['id', 'id_pers', 'ahv', 'geb', 'staatsang'], 'personen' => ['id_adr', 'vname', 'nname', 'anrede'], 'adressen' => ['str', 'plz', 'ort', 'tel', 'natel', 'email']]

JOINS

public mixed JOINS = ['LEFT JOIN personen ON id_pers=personen.id ', 'LEFT JOIN adressen ON personen.id_adr=adressen.id ']

Properties

$dbc

protected mixed $dbc

A database Connection Object

$findStatement

protected mixed $findStatement = 'SELECT ' . self::COLUMNS . ' FROM klient ' . 'LEFT JOIN personen ON id_pers=personen.id ' . 'LEFT JOIN adressen ON personen.id_adr=adressen.id ' . 'WHERE klient.del=0'

Methods

__construct()

public __construct(mixed $dbc) : mixed
Parameters
$dbc : mixed

The database Connection Object

Return values
mixed

find()

public find([mixed $id = null ]) : mixed
Parameters
$id : mixed = null
Return values
mixed

findByAHV()

public findByAHV(string $ahv[, mixed $idOwner = null ]) : mixed
Parameters
$ahv : string
$idOwner : mixed = null
Return values
mixed

sqlColumns()

protected sqlColumns(array<string|int, mixed> $tableColumns) : mixed
Parameters
$tableColumns : array<string|int, mixed>

[$table => [ $column, ... ], ...]

Return values
mixed

sqlSelectQuery()

protected sqlSelectQuery(mixed $columns, mixed $table, mixed $joins, mixed $where) : mixed
Parameters
$columns : mixed
$table : mixed
$joins : mixed
$where : mixed
Return values
mixed

Search results