ILIAS
release_8 Revision v8.19
|
ADT based-object base class Currently "mixed" with ActiveRecord-pattern, could be splitted. More...
Public Member Functions | |
__construct () | |
Constructor Tries to read record from DB, in accordance to current ILIAS behaviour. More... | |
getProperties () | |
Get all properties. More... | |
isValid () | |
Validate. More... | |
__call ($a_method, $a_value) | |
Get property magic method ("get<PropertyName>()") Setters are type-specific and cannot be magic. 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 (string $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... | |
createPrimaryKeyb () | |
Create new primary key, e.g. More... | |
initDBBridge (ilADTDBBridge $a_adt_db) | |
Init (properties) DB bridge. More... | |
initActiveRecordInstance () | |
Init active record helper for current table, primary and properties. More... | |
Protected Attributes | |
ilADT | $properties |
array | $db_errors = [] |
ilDBInterface | $db |
ilLanguage | $lng |
ADT based-object base class Currently "mixed" with ActiveRecord-pattern, could be splitted.
Definition at line 12 of file class.ilADTBasedObject.php.
ilADTBasedObject::__construct | ( | ) |
Constructor Tries to read record from DB, in accordance to current ILIAS behaviour.
Definition at line 24 of file class.ilADTBasedObject.php.
References $DIC, initProperties(), ILIAS\Repository\lng(), parsePrimary(), and read().
ilADTBasedObject::__call | ( | $a_method, | |
$a_value | |||
) |
Get property magic method ("get<PropertyName>()") Setters are type-specific and cannot be magic.
string | $a_method | |
mixed | $a_value |
Exception |
Definition at line 72 of file class.ilADTBasedObject.php.
References $type, createPrimaryKeyb(), hasPrimary(), initDBBridge(), and parsePrimary().
ilADTBasedObject::create | ( | ) |
Create record (only if valid)
Definition at line 158 of file class.ilADTBasedObject.php.
References Vendor\Package\$e, createPrimaryKeyb(), ilADTDBException\getColumn(), hasPrimary(), initActiveRecordInstance(), isValid(), and update().
Referenced by update().
|
abstractprotected |
ilADTBasedObject::delete | ( | ) |
Delete record.
Definition at line 206 of file class.ilADTBasedObject.php.
References hasPrimary(), and initActiveRecordInstance().
ilADTBasedObject::getAllTranslatedErrors | ( | string | $delimiter = "\n" | ) |
Get translated error codes (DB, Validation)
string | $delimiter |
Definition at line 249 of file class.ilADTBasedObject.php.
References getDBErrors(), getProperties(), and translateDBErrorCodes().
ilADTBasedObject::getDBErrors | ( | ) |
Get DB errors.
Definition at line 220 of file class.ilADTBasedObject.php.
References $db_errors.
Referenced by getAllTranslatedErrors().
ilADTBasedObject::getProperties | ( | ) |
Get all properties.
Definition at line 50 of file class.ilADTBasedObject.php.
References $properties.
Referenced by getAllTranslatedErrors().
|
abstractprotected |
|
protected |
Init active record helper for current table, primary and properties.
PhpParamsInspection
Definition at line 123 of file class.ilADTBasedObject.php.
References $factory, ilADTFactory\getInstance(), hasPrimary(), and initDBBridge().
Referenced by create(), delete(), read(), and update().
|
abstractprotected |
Init (properties) DB bridge.
ilADTDBBridge | $a_adt_db |
Referenced by __call(), and initActiveRecordInstance().
|
abstractprotected |
Init properties (aka set ADT definition)
Referenced by __construct().
ilADTBasedObject::isValid | ( | ) |
Validate.
Definition at line 59 of file class.ilADTBasedObject.php.
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 145 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 230 of file class.ilADTBasedObject.php.
References $res.
Referenced by getAllTranslatedErrors().
ilADTBasedObject::update | ( | ) |
Update record (only if valid)
Definition at line 183 of file class.ilADTBasedObject.php.
References Vendor\Package\$e, create(), ilADTDBException\getColumn(), hasPrimary(), initActiveRecordInstance(), and isValid().
Referenced by create().
|
protected |
Definition at line 17 of file class.ilADTBasedObject.php.
|
protected |
Definition at line 15 of file class.ilADTBasedObject.php.
Referenced by getDBErrors().
|
protected |
Definition at line 18 of file class.ilADTBasedObject.php.
|
protected |
Definition at line 14 of file class.ilADTBasedObject.php.
Referenced by getProperties().