function Query($query) { $this->query = $query; $connection = WPWB_Database::Connect(); $thisObjectName = get_class($this); $cursors = WPWB_Database::Reader($this->query, $connection); if (!empty($cursors)) { foreach ($cursors as $row) { $obj = new $thisObjectName(); $obj->fill($row); $objects[] = $obj; } return $objects; } }
function Delete() { $connection = WPWB_Database::Connect(); $this->query = $connection->prepare("DELETE FROM {$this->table} WHERE {$this->unique}='%d'", $this->{$this->unique}); return WPWB_Database::NonQuery($this->query, $connection); }