Adding fix for #2587, _ _backAssociation as real class member

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5125 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-05-20 05:05:18 +00:00
parent e2617621fd
commit dcad548cac

View file

@ -312,10 +312,10 @@ class Model extends Overloadable {
var $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); var $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
/** /**
* Holds association data to be reverted to * Holds model associations temporarily to allow for dynamic (un)binding
* *
* @var array * @var array
* @access protected * @access private
*/ */
var $__backAssociation = array(); var $__backAssociation = array();
@ -365,18 +365,18 @@ class Model extends Overloadable {
ClassRegistry::addObject($this->currentModel, $this); ClassRegistry::addObject($this->currentModel, $this);
ClassRegistry::map($this->currentModel, $this->currentModel); ClassRegistry::map($this->currentModel, $this->currentModel);
$this->id = $id; $this->id = $id;
if($table === false) { if($table === false) {
$this->useTable = false; $this->useTable = false;
} else if($table) { } else if($table) {
$this->useTable = $table; $this->useTable = $table;
} }
if ($this->useTable !== false) { if ($this->useTable !== false) {
$this->setDataSource($ds); $this->setDataSource($ds);
if ($this->useTable === null) { if ($this->useTable === null) {
$this->useTable = Inflector::tableize($this->name); $this->useTable = Inflector::tableize($this->name);
} }