Skip to content

Commit

Permalink
define class which to use for found results as class property
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLeon committed May 4, 2012
1 parent 6921a61 commit dc021cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion files/lib/data/cheatDatabase/entry/EntryList.class.php
Expand Up @@ -23,6 +23,13 @@ class EntryList extends DatabaseObjectList {
*/
public $entries = array();

/**
* Class name of the result object class
*
* @var string
*/
public $objectClassName = 'Entry';

/**
* @see DatabaseObjectList::countObjects()
*/
Expand Down Expand Up @@ -64,7 +71,7 @@ public function readObjects() {
$result = WCF::getDB()->sendQuery($sql, $this->sqlLimit, $this->sqlOffset);

while ($row = WCF::getDB()->fetchArray($result)) {
$this->entries[] = new Entry(null, $row);
$this->entries[] = new $this->objectClassName(null, $row);
}
}

Expand Down

0 comments on commit dc021cd

Please sign in to comment.