ILIAS
Release_5_0_x_branch Revision 61816
|
ADT based-object base class. More...
Public Member Functions | |
__construct () | |
Constructor. | |
getProperties () | |
Get all properties. | |
isValid () | |
Validate. | |
__call ($a_method, $a_value) | |
Get property magic method ("get<PropertyName>()") | |
read () | |
Read record. | |
create () | |
Create record (only if valid) | |
update () | |
Update record (only if valid) | |
delete () | |
Delete record. | |
getDBErrors () | |
Get DB errors. | |
translateDBErrorCodes (array $a_codes) | |
Translate DB error codes. | |
getAllTranslatedErrors ($delimiter="\n") | |
Get translated error codes (DB, Validation) |
Protected Member Functions | |
initProperties () | |
Init properties (aka set ADT definition) | |
parsePrimary (array $a_args) | |
Parse incoming primary key. | |
hasPrimary () | |
Check if currently has primary. | |
createPrimaryKey () | |
Create new primary key, e.g. | |
initDBBridge (ilADTGroupDBBridge $a_adt_db) | |
Init (properties) DB bridge. | |
initActiveRecordInstance () | |
Init active record helper for current table, primary and properties. |
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(), 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.
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 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(), and initDBBridge().
Referenced by create(), delete(), read(), and update().
|
abstractprotected |
Init (properties) DB bridge.
ilADTGroupDBBridge | $a_adt_db |
Reimplemented in ilADTTest.
Referenced by initActiveRecordInstance().
|
abstractprotected |
Init properties (aka set ADT definition)
Reimplemented in ilADTTest.
Referenced by __construct().
ilADTBasedObject::isValid | ( | ) |
Validate.
Definition at line 61 of file class.ilADTBasedObject.php.
Referenced by create(), and update().
|
abstractprotected |
Parse incoming primary key.
array | $a_args |
Reimplemented in ilADTTest.
Referenced by __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 $lng, $res, 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().