mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Replacing direct reads to schema cache and routing them to the correct method
This commit is contained in:
parent
5d1e6f9e4f
commit
a57e5e8c68
1 changed files with 5 additions and 4 deletions
|
@ -1344,7 +1344,7 @@ class Model extends Object {
|
|||
if (!empty($this->id)) {
|
||||
$success = (bool)$db->update($this, $fields, $values);
|
||||
} else {
|
||||
$fInfo = $this->_schema[$this->primaryKey];
|
||||
$fInfo = $this->schema($this->primaryKey);
|
||||
$isUUID = ($fInfo['length'] == 36 &&
|
||||
($fInfo['type'] === 'string' || $fInfo['type'] === 'binary')
|
||||
);
|
||||
|
@ -1405,10 +1405,11 @@ class Model extends Object {
|
|||
if (isset($this->hasAndBelongsToMany[$assoc])) {
|
||||
list($join) = $this->joinModel($this->hasAndBelongsToMany[$assoc]['with']);
|
||||
|
||||
$keyInfo = $this->{$join}->schema($this->{$join}->primaryKey);
|
||||
$isUUID = !empty($this->{$join}->primaryKey) && (
|
||||
$this->{$join}->_schema[$this->{$join}->primaryKey]['length'] == 36 && (
|
||||
$this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'string' ||
|
||||
$this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'binary'
|
||||
$keyInfo['length'] == 36 && (
|
||||
$keyInfo['type'] === 'string' ||
|
||||
$keyInfo['type'] === 'binary'
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue