Skip to content

Commit

Permalink
Fixing bug where sometimes key($data[0]) returned empty string instea…
Browse files Browse the repository at this point in the history
…d of first key in array
  • Loading branch information
lorenzo committed Dec 11, 2009
1 parent a81edb6 commit 22e36cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cake/libs/model/model.php
Expand Up @@ -802,7 +802,7 @@ function setSource($tableName) {
}

/**
* This function does two things:
* This function does two things:
*
* 1. it scans the array $one for the primary key,
* and if that's found, it sets the current id to the value of $one[id].
Expand Down Expand Up @@ -1043,7 +1043,7 @@ function hasField($name, $checkVirtual = false) {

/**
* Initializes the model for writing a new record, loading the default values
* for those fields that are not defined in $data, and clearing previous validation errors.
* for those fields that are not defined in $data, and clearing previous validation errors.
* Especially helpful for saving data in loops.
*
* @param mixed $data Optional data array to assign to the model after it is created. If null or false,
Expand Down Expand Up @@ -1996,7 +1996,7 @@ function hasAny($conditions = null) {
* second parameter options for finding ( indexed array, including: 'conditions', 'limit',
* 'recursive', 'page', 'fields', 'offset', 'order')
*
* Eg:
* Eg:
* {{{
* find('all', array(
* 'conditions' => array('name' => 'Thomas Anderson'),
Expand Down Expand Up @@ -2567,7 +2567,7 @@ function invalidFields($options = array()) {
$valid = preg_match($rule, $data[$fieldName]);
} elseif (Configure::read('debug') > 0) {
$error = sprintf(
__('Could not find validation handler %s for %s', true),
__('Could not find validation handler %s for %s', true),
$rule,
$fieldName
);
Expand Down

0 comments on commit 22e36cb

Please sign in to comment.