mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8070 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
79cba70758
commit
088815834e
1 changed files with 2 additions and 3 deletions
|
@ -1209,9 +1209,8 @@ class Model extends Overloadable {
|
|||
foreach ($this->_schema as $field => $properties) {
|
||||
if ($this->primaryKey === $field) {
|
||||
$fInfo = $this->_schema[$field];
|
||||
$isUUID = (
|
||||
($fInfo['type'] === 'string' && $fInfo['length'] === 36) ||
|
||||
($fInfo['type'] === 'binary' && $fInfo['length'] === 16)
|
||||
$isUUID = ($fInfo['length'] === 36 &&
|
||||
($fInfo['type'] === 'string' || $fInfo['type'] === 'binary')
|
||||
);
|
||||
if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) {
|
||||
list($fields[], $values[]) = array($this->primaryKey, String::uuid());
|
||||
|
|
Loading…
Add table
Reference in a new issue