MediportStatusMapper
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 = ['mediport_status' => ['id', 'status_message', 'created_at', 'updated_at', 'published_at', 'fk_created_by', 'fk_updated_by']]
- 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 = 'mediport_status'
- The name of the database table to build the query from.
- WHERE = []
- An array of default where clauses concatenated by AND.
Properties
Methods
- __construct() : mixed
- delete() : mixed
- find() : MediportStatus
- findAll() : Iterator
- Returns all DomainObjects of that type
- findMany() : DomainObjectCollection
- findOne() : DomainObject
- insert() : mixed
- load() : DomainObject
- 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() : MediportStatus
- customQuery() : IQuery
- doLoad() : MediportStatus
- 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
= ['mediport_status' => ['id', 'status_message', 'created_at', 'updated_at', 'published_at', 'fk_created_by', 'fk_updated_by']]
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>,
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
= 'mediport_status'
needs to be overwritten in the concrete implementations
WHERE
An array of default where clauses concatenated by AND.
public
array<string|int, mixed>
WHERE
= []
can be overwritten in the concrete implementations
[condition1, condition2, ...]
Properties
$dbc
protected
mysqli
$dbc
A database Connection Object
$fieldMap
protected
array<string|int, mixed>
$fieldMap
= []
Map DomainObjects field names to database column names
Tags
$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
delete()
public
delete(DomainObject $dmo) : mixed
Parameters
- $dmo : DomainObject
find()
public
find(int $id) : MediportStatus
Parameters
- $id : int
Return values
MediportStatusfindAll()
Returns all DomainObjects of that type
public
findAll() : Iterator
Return values
IteratorfindMany()
public
findMany(IQuery $query) : DomainObjectCollection
Parameters
- $query : IQuery
Return values
DomainObjectCollectionfindOne()
public
findOne(IQuery $query) : DomainObject
Parameters
- $query : IQuery
Tags
Return values
DomainObjectinsert()
public
insert(DomainObject $dmo) : mixed
Parameters
- $dmo : DomainObject
load()
public
load(IResultSet $rs) : DomainObject
Parameters
- $rs : IResultSet
Return values
DomainObjectloadGhost()
public
loadGhost(DomainObject $ghost) : void
Parameters
- $ghost : DomainObject
map()
public
map(Key $id, IResultSet $rs) : array<string|int, mixed>
Parameters
- $id : Key
- $rs : IResultSet
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
stringsqlWhere()
public
sqlWhere(array<string|int, mixed> $where) : mixed
Parameters
- $where : array<string|int, mixed>
store()
public
store(DomainObject $dmo) : mixed
Parameters
- $dmo : DomainObject
storeMany()
public
storeMany(mixed $dmos) : mixed
Parameters
- $dmos : mixed
update()
public
update(DomainObject $dmo) : mixed
Parameters
- $dmo : DomainObject
updateAll()
public
updateAll(DomainObject $dmo) : mixed
Parameters
- $dmo : DomainObject
abstractCreateGhost()
protected
abstractCreateGhost(DomainObject $dmo) : DomainObject
Parameters
- $dmo : DomainObject
Return values
DomainObjectabstractFind()
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
Return values
DomainObjectcreateGhost()
protected
createGhost(Key $id) : MediportStatus
Parameters
- $id : Key
Return values
MediportStatuscustomQuery()
protected
customQuery() : IQuery
check why this would be needed, we can override query() for different queries
Return values
IQuerydoLoad()
protected
doLoad(Key $id, IResultSet $rs) : MediportStatus
Parameters
- $id : Key
- $rs : IResultSet
Return values
MediportStatusinsertQuery()
Returns a new INSERT Query Instance
protected
insertQuery() : IQuery
Return values
IQueryquery()
Returns a new SELECT Query Instance.
protected
query() : IQuery
Can be overwritten to return different implementations of IQuery
Return values
IQuerysqlColumns()
protected
sqlColumns(array<string|int, mixed> $tableColumns) : string
Parameters
- $tableColumns : array<string|int, mixed>
-
[$table => [ $column, ... ], ...]
Return values
stringsqlDeleteQuery()
protected
sqlDeleteQuery(string $table, string $where) : string
Parameters
- $table : string
- $where : string
-
condition
Return values
stringsqlInsertQuery()
protected
sqlInsertQuery(array<string|int, mixed> $values, string $table) : string
Parameters
- $values : array<string|int, mixed>
-
[$field => $value, ...]
- $table : string
Return values
stringsqlJoins()
protected
sqlJoins(array<string|int, mixed> $joins) : string
Parameters
- $joins : array<string|int, mixed>
Return values
stringsqlSelectQuery()
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
stringsqlUpdateQuery()
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
stringupdateQuery()
Returns a new UPDATE Query Instance
protected
updateQuery() : IQuery