19 declare(strict_types=1);
42 $this->db = $DIC->database();
51 throw new \InvalidArgumentException(
'ADTDBBridge Type mismatch.');
61 public function setTable(
string $a_table): void
63 $this->table = $a_table;
95 $this->primary = $a_value;
120 foreach ($this->primary as $field => $def) {
121 $sql[] = $field .
"=" . $this->db->quote($def[1], $def[0]);
123 return implode(
" AND ", $sql);
130 abstract public function readRecord(array $a_row): void;
136 abstract public function prepareInsert(array &$a_fields): void;
setPrimary(array $a_value)
Set primary fields (in MDB2 format)
buildPrimaryWhere()
Convert primary keys array to sql string.
supportsDefaultValueColumn()
true if table storage relies on the default 'value' column
getPrimary()
Get primary fields.
getElementId()
Get element id.
__construct(ilADT $a_adt)
Constructor.
ADT DB bridge base class.
afterInsert()
After insert hook to enable sub-tables.
getAdditionalPrimaryFields()
setTable(string $a_table)
readRecord(array $a_row)
Import DB values to ADT.
afterDelete()
After delete hook to enable sub-tables.
prepareInsert(array &$a_fields)
Prepare ADT values for insert.
setElementId(string $a_value)
Set element id (aka DB column[s] [prefix])
afterUpdate()
After update hook to enable sub-tables.
prepareUpdate(array &$a_fields)