Adding SQL Server column aliasing fix for hasMany/HABTM associations (Ticket #1931)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4416 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-02-02 20:14:03 +00:00
parent e1ea3674d6
commit 46aa081d5c

View file

@ -112,7 +112,6 @@ class DboMssql extends DboSource {
mssql_min_error_severity(2); mssql_min_error_severity(2);
return parent::__construct($config); return parent::__construct($config);
} }
/** /**
* Connects to the database using options in the given configuration array. * Connects to the database using options in the given configuration array.
* *
@ -145,7 +144,6 @@ class DboMssql extends DboSource {
$this->connected = true; $this->connected = true;
} }
} }
/** /**
* Disconnects from database. * Disconnects from database.
* *
@ -191,7 +189,6 @@ class DboMssql extends DboSource {
return $tables; return $tables;
} }
} }
/** /**
* Returns an array of the fields in given table name. * Returns an array of the fields in given table name.
* *
@ -239,7 +236,6 @@ class DboMssql extends DboSource {
return r(']]', ']', r('[[', '[', $data)); return r(']]', ']', r('[[', '[', $data));
} }
/** /**
* Returns a quoted and escaped string of $data for use in an SQL statement. * Returns a quoted and escaped string of $data for use in an SQL statement.
* *
@ -275,7 +271,6 @@ class DboMssql extends DboSource {
} }
return "'" . $data . "'"; return "'" . $data . "'";
} }
/** /**
* Generates the fields list of an SQL query. * Generates the fields list of an SQL query.
* *
@ -322,7 +317,6 @@ class DboMssql extends DboSource {
} }
return $fields; return $fields;
} }
/** /**
* Begin a transaction * Begin a transaction
* *
@ -339,7 +333,6 @@ class DboMssql extends DboSource {
} }
return false; return false;
} }
/** /**
* Commit a transaction * Commit a transaction
* *
@ -355,7 +348,6 @@ class DboMssql extends DboSource {
} }
return false; return false;
} }
/** /**
* Rollback a transaction * Rollback a transaction
* *
@ -370,7 +362,6 @@ class DboMssql extends DboSource {
} }
return false; return false;
} }
/** /**
* Removes Identity (primary key) column from update data before returning to parent * Removes Identity (primary key) column from update data before returning to parent
* *
@ -387,10 +378,8 @@ class DboMssql extends DboSource {
break; break;
} }
} }
return parent::update($model, $fields, $values); return parent::update($model, $fields, $values);
} }
/** /**
* Returns a formatted error message from previous database operation. * Returns a formatted error message from previous database operation.
* *
@ -404,10 +393,8 @@ class DboMssql extends DboSource {
return $error; return $error;
} }
} }
return null; return null;
} }
/** /**
* Returns number of affected rows in previous database operation. If no previous operation exists, * Returns number of affected rows in previous database operation. If no previous operation exists,
* this returns false. * this returns false.
@ -420,7 +407,6 @@ class DboMssql extends DboSource {
} }
return null; return null;
} }
/** /**
* Returns number of rows in previous resultset. If no previous resultset exists, * Returns number of rows in previous resultset. If no previous resultset exists,
* this returns false. * this returns false.
@ -433,7 +419,6 @@ class DboMssql extends DboSource {
} }
return null; return null;
} }
/** /**
* Returns the ID generated from the previous INSERT operation. * Returns the ID generated from the previous INSERT operation.
* *
@ -444,7 +429,6 @@ class DboMssql extends DboSource {
$id = $this->fetchAll('SELECT SCOPE_IDENTITY() AS insertID', false); $id = $this->fetchAll('SELECT SCOPE_IDENTITY() AS insertID', false);
return $id[0][0]['insertID']; return $id[0][0]['insertID'];
} }
/** /**
* Returns a limit statement in the correct format for the particular database. * Returns a limit statement in the correct format for the particular database.
* *
@ -462,10 +446,8 @@ class DboMssql extends DboSource {
$rt .= ' ' . $limit; $rt .= ' ' . $limit;
return $rt; return $rt;
} }
return null; return null;
} }
/** /**
* Converts database-layer column types to basic types * Converts database-layer column types to basic types
* *
@ -515,7 +497,6 @@ class DboMssql extends DboSource {
} }
return 'text'; return 'text';
} }
/** /**
* Enter description here... * Enter description here...
* *
@ -541,7 +522,6 @@ class DboMssql extends DboSource {
} else { } else {
$this->map[$index++] = array(0, $column); $this->map[$index++] = array(0, $column);
} }
$j++; $j++;
} }
} }
@ -553,8 +533,8 @@ class DboMssql extends DboSource {
* @param boolean $cache Enables returning/storing cached query results * @param boolean $cache Enables returning/storing cached query results
* @return array Array of resultset rows, or false if no rows matched * @return array Array of resultset rows, or false if no rows matched
*/ */
function fetchAll($sql, $cache = true, $modelName = null) { function read(&$model, $queryData = array(), $recursive = null) {
$results = parent::fetchAll($sql, $cache, $modelName); $results = parent::read($model, $queryData, $recursive);
$this->__fieldMappings = array(); $this->__fieldMappings = array();
return $results; return $results;
} }