mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
rename the method and fix docblock return type
This commit is contained in:
parent
b3dba95b7d
commit
49ea72e53e
1 changed files with 4 additions and 4 deletions
|
@ -1721,7 +1721,7 @@ class Model extends Object implements CakeEventListener {
|
|||
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();
|
||||
|
@ -1771,9 +1771,9 @@ class Model extends Object implements CakeEventListener {
|
|||
* 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'));
|
||||
}
|
||||
|
@ -1800,7 +1800,7 @@ class Model extends Object implements CakeEventListener {
|
|||
$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;
|
||||
|
|
Loading…
Reference in a new issue