Skip to content
This repository
Browse code

Applying patch from Daniel Feinberg for Containable

Removes __backContainableAssociation as its not needed and causes
more problems than it solves.
Fixes #1762
  • Loading branch information...
commit ac0b2b8280a39e27fefe1050783e67867b10c91f 1 parent 95b275d
Mark Story authored September 07, 2011

Showing 1 changed file with 0 additions and 20 deletions. Show diff stats Hide diff stats

  1. 20  cake/libs/model/behaviors/containable.php
20  cake/libs/model/behaviors/containable.php
@@ -147,8 +147,6 @@ function beforeFind(&$Model, $query) {
147 147
 					if (!empty($unbind)) {
148 148
 						if (!$reset && empty($instance->__backOriginalAssociation)) {
149 149
 							$instance->__backOriginalAssociation = $backupBindings;
150  
-						} else if ($reset && empty($instance->__backContainableAssociation)) {
151  
-							$instance->__backContainableAssociation = $backupBindings;
152 150
 						}
153 151
 						$instance->unbindModel(array($type => $unbind), $reset);
154 152
 					}
@@ -220,24 +218,6 @@ function beforeFind(&$Model, $query) {
220 218
 	}
221 219
 
222 220
 /**
223  
- * Resets original associations on models that may have receive multiple,
224  
- * subsequent unbindings.
225  
- *
226  
- * @param object $Model Model on which we are resetting
227  
- * @param array $results Results of the find operation
228  
- * @param bool $primary true if this is the primary model that issued the find operation, false otherwise
229  
- * @access public
230  
- */
231  
-	function afterFind(&$Model, $results, $primary) {
232  
-		if (!empty($Model->__backContainableAssociation)) {
233  
-			foreach ($Model->__backContainableAssociation as $relation => $bindings) {
234  
-				$Model->{$relation} = $bindings;
235  
-				unset($Model->__backContainableAssociation);
236  
-			}
237  
-		}
238  
-	}
239  
-
240  
-/**
241 221
  * Unbinds all relations from a model except the specified ones. Calling this function without
242 222
  * parameters unbinds all related models.
243 223
  *

0 notes on commit ac0b2b8

Please sign in to comment.
Something went wrong with that request. Please try again.