From a57e5e8c687ed74b776795bd3305f27d1bd20af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez=20Urdaneta?= Date: Thu, 15 Jul 2010 21:19:23 -0430 Subject: [PATCH] Replacing direct reads to schema cache and routing them to the correct method --- cake/libs/model/model.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 5b16622e5..1bce8900a 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -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' ) );