Adding coding-issue fix (Ticket #1633), and insert ID fix (Ticket #1641), and updating method reference

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3857 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-11-10 18:45:46 +00:00
parent 31623de654
commit 26955aefda

View file

@ -302,6 +302,7 @@ class DboSource extends DataSource {
* @see DboSource::fetchRow
*/
function fetchArray() {
trigger_error('Deprecated: Use DboSource::fetchRow() instead', E_USER_WARNING);
return $this->fetchRow();
}
/**
@ -309,6 +310,7 @@ class DboSource extends DataSource {
* @see DboSource::fetchRow
*/
function one($sql) {
trigger_error('Deprecated: Use DboSource::fetchRow($sql) instead', E_USER_WARNING);
return $this->fetchRow($sql);
}
/**
@ -504,7 +506,7 @@ class DboSource extends DataSource {
}
if ($this->execute('INSERT INTO ' . $this->fullTableName($model) . ' (' . join(',', $fieldInsert). ') VALUES (' . join(',', $valueInsert) . ')')) {
if ($id === null) {
if (empty($id)) {
$id = $this->lastInsertId($this->fullTableName($model, false), $model->primaryKey);
}
$model->setInsertID($id);
@ -640,8 +642,6 @@ class DboSource extends DataSource {
if (isset($model->{$className}) && is_object($model->{$className})) {
$data = $model->{$className}->afterFind(array(array($key => $results[$i][$key])), false);
} else {
$data = $model->{$className}->afterFind(array(array($key => $results[$i][$key])), false);
}
$results[$i][$key] = $data[0][$key];
}
@ -1549,7 +1549,7 @@ class DboSource extends DataSource {
}
if (is_array($keys)) {
if (countdim($keys) > 1) {
if (Set::countDim($keys) > 1) {
$new = array();
foreach($keys as $val) {