mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Removing mor assignments by reference
This commit is contained in:
parent
bcc1417e5d
commit
122cb1ec5b
1 changed files with 5 additions and 5 deletions
|
@ -65,7 +65,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
|
||||
if (in_array($settings['scope'], $Model->getAssociated('belongsTo'))) {
|
||||
$data = $Model->getAssociated($settings['scope']);
|
||||
$parent =& $Model->{$settings['scope']};
|
||||
$parent = $Model->{$settings['scope']};
|
||||
$settings['scope'] = $Model->alias . '.' . $data['foreignKey'] . ' = ' . $parent->alias . '.' . $parent->primaryKey;
|
||||
$settings['recursive'] = 0;
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
$this->_setParent($Model, $array[$Model->alias][$parent]);
|
||||
}
|
||||
} else {
|
||||
$db =& ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
foreach ($Model->find('all', array('conditions' => $scope, 'fields' => array($Model->primaryKey, $parent), 'order' => $left)) as $array) {
|
||||
$path = $this->getPath($Model, $array[$Model->alias][$Model->primaryKey]);
|
||||
if ($path == null || count($path) < 2) {
|
||||
|
@ -702,7 +702,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
$parentNode[$right] = $node[$right] + 1;
|
||||
}
|
||||
|
||||
$db =& ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
$Model->updateAll(
|
||||
array($parent => $db->value($node[$parent], $parent)),
|
||||
array($Model->escapeField($parent) => $node[$Model->primaryKey])
|
||||
|
@ -888,7 +888,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
* @access private
|
||||
*/
|
||||
function __getMax($Model, $scope, $right, $recursive = -1, $created = false) {
|
||||
$db =& ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
if ($created) {
|
||||
if (is_string($scope)) {
|
||||
$scope .= " AND {$Model->alias}.{$Model->primaryKey} <> ";
|
||||
|
@ -916,7 +916,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
* @access private
|
||||
*/
|
||||
function __getMin($Model, $scope, $left, $recursive = -1) {
|
||||
$db =& ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($Model->useDbConfig);
|
||||
$name = $Model->alias . '.' . $left;
|
||||
list($edge) = array_values($Model->find('first', array(
|
||||
'conditions' => $scope,
|
||||
|
|
Loading…
Add table
Reference in a new issue