diff --git a/libs/model.php b/libs/model.php index 50df60f37..6a8e83212 100644 --- a/libs/model.php +++ b/libs/model.php @@ -201,20 +201,18 @@ class Model extends Object { return $this->_belongsToLink(); } - if (!empty($this->hasOne)) { $this->_hasOneLink(); - } - if (!empty($this->hasMany)) - { - return $this->_hasManyLinks(); - } - - if (!empty($this->hasAndBelongsToMany)) - { - return $this->_hasAndBelongsToManyLinks(); - } + } + if (!empty($this->hasMany)) + { + return $this->_hasManyLinks(); + } + if (!empty($this->hasAndBelongsToMany)) + { + return $this->_hasAndBelongsToManyLinks(); + } } /** @@ -528,19 +526,19 @@ class Model extends Object switch($type) { case 'Belongs': - $joinedHas = 'joinedBelongsTo'; + $joined = 'joinedBelongsTo'; break; case 'One': - $joinedHas = 'joinedHasOne'; + $joined = 'joinedHasOne'; break; case 'Many': - $joinedHas = 'joinedHasMany'; + $joined = 'joinedHasMany'; break; case 'ManyTo': - $joinedHas = 'joinedHasAndBelongs'; + $joined = 'joinedHasAndBelongs'; break; default: @@ -553,7 +551,7 @@ class Model extends Object { $this->$className = new $className(); } - $this->{$joinedHas}[] = $this->$className; + $this->{$joined}[] = $this->$className; $this->relink($type); } @@ -678,22 +676,18 @@ class Model extends Object switch ($type) { case 'Belongs': - $this->_belongsToOther[] = array($tableName, $field_name, $value); break; case 'One': - //$field_name = Inflector::singularize($tableName).'_id'; $this->_oneToOne[] = array($tableName, $field_name, $value); break; case 'Many': - $this->_oneToMany[] = array($tableName, $field_name, $value); break; case 'ManyTo': - $this->_manyToMany = array(); break; } diff --git a/libs/model_collection.php b/libs/model_collection.php new file mode 100644 index 000000000..6b22be298 --- /dev/null +++ b/libs/model_collection.php @@ -0,0 +1,53 @@ + + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + Licensed under The MIT License + // +// + Redistributions of files must retain the above copyright notice. + // +// + See: http://www.opensource.org/licenses/mit-license.php + // +////////////////////////////////////////////////////////////////////////// + +/** + * Model Collections. + * + * @filesource + * @author CakePHP Authors/Developers + * @copyright Copyright (c) 2005, CakePHP Authors/Developers + * @link https://trac.cakephp.org/wiki/Authors Authors/Developers + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.9.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * + */ + +/** + * Model Collections. + * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.9.2 + * + */ + class ModelCollection + { + +/** + * Enter description here... + * + * @return ModelCollection + */ + function ModelCollection() + { + } + } +?> \ No newline at end of file