Skip to content

Commit

Permalink
rename the method and fix docblock return type
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Dec 8, 2012
1 parent b3dba95 commit 49ea72e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Model/Model.php
Expand Up @@ -1721,7 +1721,7 @@ public function save($data = null, $validate = true, $fieldList = array()) {
if (!empty($this->id)) {
$success = (bool)$db->update($this, $fields, $values);
} else {
if (empty($this->data[$this->alias][$this->primaryKey]) && $this->_isUUID($this->primaryKey)) {
if (empty($this->data[$this->alias][$this->primaryKey]) && $this->_isUUIDField($this->primaryKey)) {
if (array_key_exists($this->primaryKey, $this->data[$this->alias])) {
$j = array_search($this->primaryKey, $fields);
$values[$j] = String::uuid();
Expand Down Expand Up @@ -1771,9 +1771,9 @@ public function save($data = null, $validate = true, $fieldList = array()) {
* Check if the passed in field is a UUID field
*
* @param string $field the field to check
* @return array
* @return boolean
*/
protected function _isUUID($field) {
protected function _isUUIDField($field) {
$field = $this->schema($field);
return $field['length'] == 36 && in_array($field['type'], array('string', 'binary'));
}
Expand All @@ -1800,7 +1800,7 @@ protected function _saveMulti($joined, $id, $db) {
$dbMulti = $db;
}

$isUUID = !empty($this->{$join}->primaryKey) && $this->{$join}->_isUUID($this->{$join}->primaryKey);
$isUUID = !empty($this->{$join}->primaryKey) && $this->{$join}->_isUUIDField($this->{$join}->primaryKey);

$newData = $newValues = $newJoins = array();
$primaryAdded = false;
Expand Down

0 comments on commit 49ea72e

Please sign in to comment.