ADT Active Record helper class.
More...
ADT Active Record helper class.
This class expects a valid primary for all actions!
- Author
- Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
- Version
- $Id$
Definition at line 13 of file class.ilADTActiveRecord.php.
◆ __construct()
◆ create()
ilADTActiveRecord::create |
( |
| ) |
|
Create/insert record.
Definition at line 56 of file class.ilADTActiveRecord.php.
References $DIC, and $ilDB.
62 $fields = $this->properties->getPrimary();
63 $this->properties->prepareInsert($fields);
65 $ilDB->insert($this->properties->getTable(), $fields);
68 $this->properties->afterInsert();
◆ delete()
ilADTActiveRecord::delete |
( |
| ) |
|
Delete record.
Definition at line 93 of file class.ilADTActiveRecord.php.
References $DIC, and $ilDB.
99 $ilDB->manipulate(
"DELETE FROM " . $this->properties->getTable() .
100 " WHERE " . $this->properties->buildPrimaryWhere());
103 $this->properties->afterDelete();
◆ read()
ilADTActiveRecord::read |
( |
| ) |
|
Read record.
- Returns
- boolean
Definition at line 33 of file class.ilADTActiveRecord.php.
References $DIC, and $ilDB.
40 $this->properties->getADT()->reset();
42 $sql =
"SELECT * FROM " . $this->properties->getTable() .
43 " WHERE " . $this->properties->buildPrimaryWhere();
44 $set =
$ilDB->query($sql);
45 if (
$ilDB->numRows($set)) {
46 $row =
$ilDB->fetchAssoc($set);
47 $this->properties->readRecord($row);
◆ update()
ilADTActiveRecord::update |
( |
| ) |
|
Update record.
Definition at line 74 of file class.ilADTActiveRecord.php.
References $DIC, and $ilDB.
81 $this->properties->prepareUpdate($fields);
84 $ilDB->update($this->properties->getTable(), $fields, $this->properties->getPrimary());
87 $this->properties->afterUpdate();
◆ $properties
ilADTActiveRecord::$properties |
|
protected |
The documentation for this class was generated from the following file: