Documentation

OwnerMapper extends AbstractMapper
in package

The AbstractMapper is used to retrieve and store DomainObjects from and to the Database

A DataMapper implementation has to provide the methods for interaction
But There should be find[ByXYZ] methods to retreive the respective DomainObject and insert/update methods to store the data to the Database

Table of Contents

Constants

COLUMNS  = [self::TABLE => ['id', 'logo', 'anrede', 'vname', 'nname', 'orga', 'benutzer', 'gln', 'admin', 'billcare', 'spitex', 'mod_ekarus', 'mod_xml', 'mod_pop', 'mod_qr', 'mod_kompl', 'mod_dp', 'mod_tp', 'com_grundeinstellungen', 'com_weitere_aufg', 'com_statistik', 'com_abrechnung', 'com_kl_bearbeiten', 'com_kl_neu', 'com_doku', 'com_medi', 'com_anamn', 'com_kontakte', 'com_verordnung', 'com_controlling_az', 'com_show_pp', 'com_services', 'com_showPbEntry']]
An array of all the database columns to build the query from.
JOINS  = []
An array of database joins to build the query from.
ORDERCOLUMNS  = []
An array of default order columns.
TABLE  = 'owner'
The name of the database table to build the query from.
WHERE  = ['owner.del=0']
An array of default where clauses concatenated by AND.

Properties

$dbc  : mysqli
$fieldMap  : array<string|int, mixed>
$map  : array<string|int, mixed>

Methods

__construct()  : mixed
delete()  : mixed
doLoad()  : Owner
find()  : Owner
findAll()  : Iterator
Returns all DomainObjects of that type
findMany()  : DomainObjectCollection
findOne()  : DomainObject
insert()  : mixed
load()  : DomainObject
loadClientsInCare()  : array<string|int, mixed>
loadGhost()  : void
map()  : array<string|int, mixed>
mapValues()  : mixed
Map DomainObjectValues to database column values
sqlOrderBy()  : string
sqlWhere()  : mixed
store()  : mixed
storeMany()  : mixed
update()  : mixed
updateAll()  : mixed
abstractCreateGhost()  : DomainObject
abstractFind()  : DomainObject
Executes an sql select statement
createGhost()  : Owner
customQuery()  : IQuery
insertQuery()  : IQuery
Returns a new INSERT Query Instance
query()  : IQuery
Returns a new SELECT Query Instance.
sqlColumns()  : string
sqlDeleteQuery()  : string
sqlInsertQuery()  : string
sqlJoins()  : string
sqlSelectQuery()  : string
sqlUpdateQuery()  : string
updateQuery()  : IQuery
Returns a new UPDATE Query Instance

Constants

COLUMNS

An array of all the database columns to build the query from.

public array<string|int, mixed> COLUMNS = [self::TABLE => ['id', 'logo', 'anrede', 'vname', 'nname', 'orga', 'benutzer', 'gln', 'admin', 'billcare', 'spitex', 'mod_ekarus', 'mod_xml', 'mod_pop', 'mod_qr', 'mod_kompl', 'mod_dp', 'mod_tp', 'com_grundeinstellungen', 'com_weitere_aufg', 'com_statistik', 'com_abrechnung', 'com_kl_bearbeiten', 'com_kl_neu', 'com_doku', 'com_medi', 'com_anamn', 'com_kontakte', 'com_verordnung', 'com_controlling_az', 'com_show_pp', 'com_services', 'com_showPbEntry']]

needs to be overwritten in the concrete implementations

self::TABLE => [col1, col2, ...]

JOINS

An array of database joins to build the query from.

public array<string|int, joinIndex> JOINS = []

can be overwritten in the concrete implementations

=> [<joinType>, , <joinCondition>, [col1, col2, ...]]

ORDERCOLUMNS

An array of default order columns.

public array<string|int, mixed> ORDERCOLUMNS = []

can be overwritten in the concrete implementations

TABLE

The name of the database table to build the query from.

public string TABLE = 'owner'

needs to be overwritten in the concrete implementations

WHERE

An array of default where clauses concatenated by AND.

public array<string|int, mixed> WHERE = ['owner.del=0']

can be overwritten in the concrete implementations

[condition1, condition2, ...]

Properties

$fieldMap

protected array<string|int, mixed> $fieldMap = ['id' => 'id', 'logo' => 'logo', 'username' => 'benutzer', 'firstname' => 'vname', 'lastname' => 'nname', 'gln' => 'gln', 'admin' => 'admin', 'billcare' => 'billcare', 'spitex' => 'spitex', 'bcModule' => 'billcare', 'xmlModule' => 'mod_xml', 'ekarusModule' => 'mod_ekarus', 'complementaryModule' => 'mod_kompl', 'popModule' => 'mod_pop', 'qrModule' => 'mod_qr', 'dpModule' => 'mod_dp', 'tpModule' => 'mod_tp', 'dpRights' => 'mod_dp', 'tpRights' => 'mod_tp', 'componentBasic' => 'com_grundeinstellungen', 'componentOther' => 'com_weitere_aufg', 'componentStatistics' => 'com_statistik', 'componentAccounting' => 'com_abrechnung']

Map DomainObjects field names to database column names

$map

protected static array<string|int, mixed> $map

Identity Map of DomainObjects

Methods

__construct()

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

The database Connection Object

findAll()

Returns all DomainObjects of that type

public findAll() : Iterator
Return values
Iterator

loadClientsInCare()

public loadClientsInCare(Key $ownerId) : array<string|int, mixed>
Parameters
$ownerId : Key
Return values
array<string|int, mixed>

mapValues()

Map DomainObjectValues to database column values

public mapValues(array<string|int, mixed> $values[, bool $escape = true ]) : mixed
Parameters
$values : array<string|int, mixed>

array of [fieldName => value] pairs

$escape : bool = true

If set to false the mapped value will not be mysql_real_escaped

sqlOrderBy()

public sqlOrderBy(array<string|int, mixed> $orderColumns) : string
Parameters
$orderColumns : array<string|int, mixed>
Return values
string

sqlWhere()

public sqlWhere(array<string|int, mixed> $where) : mixed
Parameters
$where : array<string|int, mixed>

storeMany()

public storeMany(mixed $dmos) : mixed
Parameters
$dmos : mixed

abstractFind()

Executes an sql select statement

protected abstractFind(string|Varchar|int $id, IQuery $query) : DomainObject

checks if object is already in the identity map and returns it, if not it executes the sql.

Parameters
$id : string|Varchar|int

The Primary Key

$query : IQuery
Tags
throws
OutOfRangeException

If the $id is not found in the database

Return values
DomainObject

customQuery()

protected customQuery() : IQuery

check why this would be needed, we can override query() for different queries

Return values
IQuery

query()

Returns a new SELECT Query Instance.

protected query() : IQuery

Can be overwritten to return different implementations of IQuery

Return values
IQuery

sqlColumns()

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

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

Return values
string

sqlDeleteQuery()

protected sqlDeleteQuery(string $table, string $where) : string
Parameters
$table : string
$where : string

condition

Return values
string

sqlInsertQuery()

protected sqlInsertQuery(array<string|int, mixed> $values, string $table) : string
Parameters
$values : array<string|int, mixed>

[$field => $value, ...]

$table : string
Return values
string

sqlJoins()

protected sqlJoins(array<string|int, mixed> $joins) : string
Parameters
$joins : array<string|int, mixed>
Return values
string

sqlSelectQuery()

protected sqlSelectQuery(array<string|int, mixed> $columns, string $table, array<string|int, mixed> $joins, array<string|int, mixed> $where, array<string|int, mixed> $orderColumns) : string
Parameters
$columns : array<string|int, mixed>

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

$table : string
$joins : array<string|int, mixed>

array of sql joins

$where : array<string|int, mixed>

array of where clauses joined with AND

$orderColumns : array<string|int, mixed>

array of order clauses joined with ,

Return values
string

sqlUpdateQuery()

protected sqlUpdateQuery(array<string|int, mixed> $values, string $table, string $where) : string
Parameters
$values : array<string|int, mixed>
$table : string
$where : string

condition

Return values
string

        
On this page

Search results