63        return $this->properties->isValid();
 
   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));
 
   83                if (!$this->properties->hasElement($parsed)) {
 
   84                    throw new Exception(
"ilADTObject unknown property " . $parsed);
 
   86                return $this->properties->getElement($parsed);
 
   89                throw new Exception(
"ilADTObject unknown method " . $parsed);
 
  139            throw new Exception(
"ilADTBasedObject no primary");
 
  143        $this->adt_db = 
$factory->getDBBridgeForInstance($this->properties);
 
  147        include_once 
"Services/ADT/classes/class.ilADTDBException.php";
 
  148        $ilDB->exception = 
"ilADTDBException";
 
  150        return $factory->getActiveRecordInstance($this->adt_db);
 
  184                    $this->db_errors[$e->
getColumn()][] = $e->getCode();
 
  209                $this->db_errors[$e->
getColumn()][] = $e->getCode();
 
  222    public function delete()
 
  256        foreach ($a_codes as 
$code) {
 
  258                case MDB2_ERROR_CONSTRAINT:
 
  259                    $res[] = 
$lng->txt(
"adt_error_db_constraint");
 
  263                    $res[] = 
"Unknown ADT error code " . 
$code;
 
  281        foreach ($this->
getProperties()->getValidationErrorsByElements() as $error_code => $element_id) {
 
  282            $tmp[] = $element_id . 
" [validation]: " . $this->
getProperties()->translateErrorCode($error_code);
 
  285        foreach ($this->
getDBErrors() as $element_id => $codes) {
 
An exception for terminatinating execution or to throw for unit testing.
ADT based-object base class.
initActiveRecordInstance()
Init active record helper for current table, primary and properties.
__construct()
Constructor.
initProperties()
Init properties (aka set ADT definition)
__call($a_method, $a_value)
Get property magic method ("get<PropertyName>()")
createPrimaryKey()
Create new primary key, e.g.
translateDBErrorCodes(array $a_codes)
Translate DB error codes.
initDBBridge(ilADTGroupDBBridge $a_adt_db)
Init (properties) DB bridge.
getDBErrors()
Get DB errors.
getAllTranslatedErrors($delimiter="\n")
Get translated error codes (DB, Validation)
hasPrimary()
Check if currently has primary.
parsePrimary(array $a_args)
Parse incoming primary key.
update()
Update record (only if valid)
create()
Create record (only if valid)
getProperties()
Get all properties.
static getInstance()
Get singleton.
foreach($_POST as $key=> $value) $res