76 public function __call($a_method, $a_value)
78 $type = substr($a_method, 0, 3);
81 $parsed = strtolower(preg_replace(
"/([A-Z])/",
" $1", substr($a_method, 3)));
82 $parsed = str_replace(
" ",
"_", trim($parsed));
84 throw new Exception(
"ilADTObject unknown property " . $parsed);
89 throw new Exception(
"ilADTObject unknown method " . $parsed);
137 throw new Exception(
"ilADTBasedObject no primary");
145 include_once
"Services/ADT/classes/class.ilADTDBException.php";
146 $ilDB->exception =
"ilADTDBException";
148 return $factory->getActiveRecordInstance($this->adt_db);
182 $this->db_errors[$e->
getColumn()][] = $e->getCode();
207 $this->db_errors[$e->
getColumn()][] = $e->getCode();
220 public function delete()
252 foreach ($a_codes as
$code) {
255 $res[] = $lng->txt(
"adt_error_db_constraint");
259 $res[] =
"Unknown ADT error code " .
$code;
277 foreach ($this->
getProperties()->getValidationErrorsByElements() as $error_code => $element_id) {
278 $tmp[] = $element_id .
" [validation]: " . $this->
getProperties()->translateErrorCode($error_code);
281 foreach ($this->
getDBErrors() as $element_id => $codes) {
initActiveRecordInstance()
Init active record helper for current table, primary and properties.
hasPrimary()
Check if currently has primary.
createPrimaryKey()
Create new primary key, e.g.
translateDBErrorCodes(array $a_codes)
Translate DB error codes.
initProperties()
Init properties (aka set ADT definition)
static getInstance()
Get singleton.
__construct()
Constructor.
const MDB2_ERROR_CONSTRAINT
parsePrimary(array $a_args)
Parse incoming primary key.
getDBErrors()
Get DB errors.
initDBBridge(ilADTGroupDBBridge $a_adt_db)
Init (properties) DB bridge.
foreach($_POST as $key=> $value) $res
update()
Update record (only if valid)
__call($a_method, $a_value)
Get property magic method ("get<PropertyName>()")
getProperties()
Get all properties.
Create styles array
The data for the language used.
getAllTranslatedErrors($delimiter="\)
Get translated error codes (DB, Validation)
ADT based-object base class.
create()
Create record (only if valid)