WIP sofar

This commit is contained in:
Deon George
2011-04-06 09:12:31 +10:00
parent 939d0a43d6
commit 6d858a982a
8 changed files with 202 additions and 9 deletions

View File

@@ -83,8 +83,9 @@ class Database_TSM extends Database {
else
{
// Create a connection and force it to be a new link
$this->_connection = sprintf('%s -id=%s -password=%s -displ=list -dataonly=YES %s %s',
$this->_connection = sprintf('%s %s -id=%s -password=%s -displ=list -dataonly=YES %s %s',
Kohana::config('config.client'),
Kohana::config('config.stanza') ? '-server='.Kohana::config('config.stanza') : '',
$username,
$password,
Kohana::config('config.client_errorlogname') ? sprintf('-errorlogname=%s',Kohana::config('config.client_errorlogname')) : '',

View File

@@ -59,9 +59,6 @@ class Database_TSM_Result extends Database_Result {
if ($this->_current_row !== $this->_internal_row AND ! $this->seek($this->_current_row))
return FALSE;
// Increment internal row for optimization assuming rows are fetched in order
$this->_internal_row++;
if ($this->_as_object === TRUE)
{
// Return an stdClass
@@ -72,14 +69,24 @@ class Database_TSM_Result extends Database_Result {
// Return an object of given class name
$o = new $this->_as_object;
return $o->_load_values($this->_rows[$this->_current_row++]);
return $o->_load_values($this->_rows[$this->_current_row]);
}
else
{
// Return an array of the row
return $this->_rows[$this->_current_row++];
return $this->_rows[$this->_current_row];
}
}
/**
* Get a row value from the query
*
* TSM returns all columns in upper case
*/
public function get($name, $default = NULL) {
$name = strtoupper($name);
return parent::get($name,$default);
}
} // End Database_TSM_Result
?>