76 public function __call($a_method, $a_value)
78 $type = substr($a_method, 0, 3);
82 $parsed = strtolower(preg_replace(
"/([A-Z])/",
" $1", substr($a_method, 3)));
83 $parsed = str_replace(
" ",
"_", trim($parsed));
86 throw new Exception(
"ilADTObject unknown property ".$parsed);
91 throw new Exception(
"ilADTObject unknown method ".$parsed);
140 throw new Exception(
"ilADTBasedObject no primary");
144 $this->adt_db = $factory->getDBBridgeForInstance($this->
properties);
148 include_once
"Services/ADT/classes/class.ilADTDBException.php";
149 $ilDB->exception =
"ilADTDBException";
151 return $factory->getActiveRecordInstance($this->adt_db);
192 $this->db_errors[$e->
getColumn()][] = $e->getCode();
222 $this->db_errors[$e->
getColumn()][] = $e->getCode();
235 public function delete()
268 foreach($a_codes as
$code)
273 $res[] = $lng->txt(
"adt_error_db_constraint");
277 $res[] =
"Unknown ADT error code ".$code;
295 foreach($this->
getProperties()->getValidationErrorsByElements() as $error_code => $element_id)
297 $tmp[] = $element_id.
" [validation]: ".$this->
getProperties()->translateErrorCode($error_code);
300 foreach($this->
getDBErrors() as $element_id => $codes)
307 return get_class($this).$delimiter.implode($delimiter, $tmp);
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.
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)