3 declare(strict_types=1);
28 $this->db = $DIC->database();
37 throw new \InvalidArgumentException(
'ADTDBBridge Type mismatch.');
47 public function setTable(
string $a_table): void
49 $this->table = $a_table;
81 $this->primary = $a_value;
106 foreach ($this->primary as $field => $def) {
107 $sql[] = $field .
"=" . $this->db->quote($def[1], $def[0]);
109 return implode(
" AND ", $sql);
116 abstract public function readRecord(array $a_row): void;
122 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)