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 55 of file class.ilADTActiveRecord.php.
References $ilDB.
59 $fields = $this->properties->getPrimary();
60 $this->properties->prepareInsert($fields);
62 $ilDB->insert($this->properties->getTable(), $fields);
65 $this->properties->afterInsert();
◆ delete()
ilADTActiveRecord::delete |
( |
| ) |
|
Delete record.
Definition at line 88 of file class.ilADTActiveRecord.php.
References $ilDB.
92 $ilDB->manipulate(
"DELETE FROM ".$this->properties->getTable().
93 " WHERE ".$this->properties->buildPrimaryWhere());
96 $this->properties->afterDelete();
◆ read()
ilADTActiveRecord::read |
( |
| ) |
|
Read record.
- Returns
- boolean
Definition at line 33 of file class.ilADTActiveRecord.php.
References $ilDB, and $row.
38 $this->properties->getADT()->reset();
40 $sql =
"SELECT * FROM ".$this->properties->getTable().
41 " WHERE ".$this->properties->buildPrimaryWhere();
42 $set = $ilDB->query($sql);
43 if($ilDB->numRows($set))
45 $row = $ilDB->fetchAssoc($set);
46 $this->properties->readRecord(
$row);
◆ update()
ilADTActiveRecord::update |
( |
| ) |
|
Update record.
Definition at line 71 of file class.ilADTActiveRecord.php.
References $ilDB.
76 $this->properties->prepareUpdate($fields);
79 $ilDB->update($this->properties->getTable(), $fields, $this->properties->getPrimary());
82 $this->properties->afterUpdate();
◆ $properties
ilADTActiveRecord::$properties |
|
protected |
The documentation for this class was generated from the following file: