Skip to content

Commit

Permalink
Minor recordset cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jun 9, 2008
1 parent 8673a56 commit c45ea1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
3 changes: 2 additions & 1 deletion lib/dml/adodb_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* @package dmlib
*/
class adodb_moodle_recordset extends moodle_recordset {
private $rs;

protected $rs; ///ADOdb recordset

public function __construct($rs) {
$this->rs = $rs;
Expand Down
29 changes: 1 addition & 28 deletions lib/dml/oci8po_adodb_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,12 @@
* @package dmlib
*/
class oci8po_adodb_moodle_recordset extends adodb_moodle_recordset {
private $rs;

public function __construct($rs) {
$this->rs = $rs;
}

public function current() {
/// Really DIRTY HACK for Oracle - needed because it can not see difference from NULL and ''
/// this can not be removed even if we chane db defaults :-(
/// this can not be removed even if we change db defaults :-(
$fields = $this->rs->fields;
array_walk($fields, array('oci8po_adodb_moodle_database', 'onespace2empty'));
return (object)$fields;
}

public function key() {
return $this->rs->_currentRow;
}

public function next() {
$this->rs->MoveNext();
}

public function rewind() {
//TODO - this does not work in Oracle :-(
error('Implement rewind in oracle by doing query again');
$this->rs->MoveFirst();
}

public function valid() {
return !$this->rs->EOF;
}

public function close() {
$this->rs->Close();
}
}
1 change: 1 addition & 0 deletions lib/dml/pdo_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @package dmlib
*/
class pdo_moodle_recordset extends moodle_recordset {

private $sht;

public function __construct($sth) {
Expand Down

0 comments on commit c45ea1d

Please sign in to comment.