Skip to content
Permalink
Browse files

Replacing direct reads to schema cache and routing them to the correc…

…t method
  • Loading branch information...
lorenzo committed Jul 16, 2010
1 parent 5d1e6f9 commit a57e5e8c687ed74b776795bd3305f27d1bd20af0
Showing with 5 additions and 4 deletions.
  1. +5 −4 cake/libs/model/model.php
@@ -1344,7 +1344,7 @@ function save($data = null, $validate = true, $fieldList = array()) {
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 @@ function __saveMulti($joined, $id, &$db) {
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'
)
);

0 comments on commit a57e5e8

Please sign in to comment.
You can’t perform that action at this time.