ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
ADT based-object base class. More...
Public Member Functions | |
__construct () | |
Constructor. More... | |
getProperties () | |
Get all properties. More... | |
isValid () | |
Validate. More... | |
__call ($a_method, $a_value) | |
Get property magic method ("get<PropertyName>()") More... | |
read () | |
Read record. More... | |
create () | |
Create record (only if valid) More... | |
update () | |
Update record (only if valid) More... | |
delete () | |
Delete record. More... | |
getDBErrors () | |
Get DB errors. More... | |
translateDBErrorCodes (array $a_codes) | |
Translate DB error codes. More... | |
getAllTranslatedErrors ($delimiter="\) | |
Get translated error codes (DB, Validation) More... | |
Protected Member Functions | |
initProperties () | |
Init properties (aka set ADT definition) More... | |
parsePrimary (array $a_args) | |
Parse incoming primary key. More... | |
hasPrimary () | |
Check if currently has primary. More... | |
createPrimaryKey () | |
Create new primary key, e.g. More... | |
initDBBridge (ilADTGroupDBBridge $a_adt_db) | |
Init (properties) DB bridge. More... | |
initActiveRecordInstance () | |
Init active record helper for current table, primary and properties. More... | |
Protected Attributes | |
$properties = array() | |
$db_errors = array() | |
ADT based-object base class.
Currently "mixed" with ActiveRecord-pattern, could be splitted
Definition at line 13 of file class.ilADTBasedObject.php.
ilADTBasedObject::__construct | ( | ) |
Constructor.
Tries to read record from DB, in accordance to current ILIAS behaviour
Definition at line 25 of file class.ilADTBasedObject.php.
References initProperties(), parsePrimary(), properties, and read().
ilADTBasedObject::__call | ( | $a_method, | |
$a_value | |||
) |
Get property magic method ("get<PropertyName>()")
Setters are type-specific and cannot be magic
Exception |
string | $a_method | |
mixed | $a_value |
Definition at line 76 of file class.ilADTBasedObject.php.
References array, createPrimaryKey(), hasPrimary(), initDBBridge(), parsePrimary(), and properties.
ilADTBasedObject::create | ( | ) |
Create record (only if valid)
Definition at line 174 of file class.ilADTBasedObject.php.
References createPrimaryKey(), ilADTDBException\getColumn(), hasPrimary(), initActiveRecordInstance(), isValid(), and update().
Referenced by update().
|
abstractprotected |
ilADTBasedObject::delete | ( | ) |
Delete record.
Definition at line 235 of file class.ilADTBasedObject.php.
References hasPrimary(), and initActiveRecordInstance().
ilADTBasedObject::getAllTranslatedErrors | ( | $delimiter = "\n" | ) |
Get translated error codes (DB, Validation)
type | $delimiter |
Definition at line 291 of file class.ilADTBasedObject.php.
References array, getDBErrors(), getProperties(), and translateDBErrorCodes().
ilADTBasedObject::getDBErrors | ( | ) |
Get DB errors.
Definition at line 251 of file class.ilADTBasedObject.php.
References $db_errors.
Referenced by getAllTranslatedErrors().
ilADTBasedObject::getProperties | ( | ) |
Get all properties.
Definition at line 51 of file class.ilADTBasedObject.php.
References $properties.
Referenced by getAllTranslatedErrors().
|
abstractprotected |
|
protected |
Init active record helper for current table, primary and properties.
Definition at line 134 of file class.ilADTBasedObject.php.
References $ilDB, ilADTFactory\getInstance(), hasPrimary(), initDBBridge(), and properties.
Referenced by create(), delete(), read(), and update().
|
abstractprotected |
Init (properties) DB bridge.
ilADTGroupDBBridge | $a_adt_db |
Referenced by __call(), and initActiveRecordInstance().
|
abstractprotected |
Init properties (aka set ADT definition)
Referenced by __construct().
ilADTBasedObject::isValid | ( | ) |
Validate.
Definition at line 61 of file class.ilADTBasedObject.php.
References properties.
Referenced by create(), and update().
|
abstractprotected |
Parse incoming primary key.
array | $a_args |
Referenced by __call(), and __construct().
ilADTBasedObject::read | ( | ) |
Read record.
Definition at line 159 of file class.ilADTBasedObject.php.
References hasPrimary(), and initActiveRecordInstance().
Referenced by __construct().
ilADTBasedObject::translateDBErrorCodes | ( | array | $a_codes | ) |
Translate DB error codes.
array | $a_codes |
Definition at line 262 of file class.ilADTBasedObject.php.
References $code, $lng, $res, array, and MDB2_ERROR_CONSTRAINT.
Referenced by getAllTranslatedErrors().
ilADTBasedObject::update | ( | ) |
Update record (only if valid)
Definition at line 206 of file class.ilADTBasedObject.php.
References create(), ilADTDBException\getColumn(), hasPrimary(), initActiveRecordInstance(), and isValid().
Referenced by create().
|
protected |
Definition at line 16 of file class.ilADTBasedObject.php.
Referenced by getDBErrors().
|
protected |
Definition at line 15 of file class.ilADTBasedObject.php.
Referenced by getProperties().