Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@markstory markstory authored
Showing with 0 additions and 20 deletions.
  1. +0 −20 cake/libs/model/behaviors/containable.php
View
20 cake/libs/model/behaviors/containable.php
@@ -147,8 +147,6 @@ function beforeFind(&$Model, $query) {
if (!empty($unbind)) {
if (!$reset && empty($instance->__backOriginalAssociation)) {
$instance->__backOriginalAssociation = $backupBindings;
- } else if ($reset && empty($instance->__backContainableAssociation)) {
- $instance->__backContainableAssociation = $backupBindings;
}
$instance->unbindModel(array($type => $unbind), $reset);
}
@@ -220,24 +218,6 @@ function beforeFind(&$Model, $query) {
}
/**
- * Resets original associations on models that may have receive multiple,
- * subsequent unbindings.
- *
- * @param object $Model Model on which we are resetting
- * @param array $results Results of the find operation
- * @param bool $primary true if this is the primary model that issued the find operation, false otherwise
- * @access public
- */
- function afterFind(&$Model, $results, $primary) {
- if (!empty($Model->__backContainableAssociation)) {
- foreach ($Model->__backContainableAssociation as $relation => $bindings) {
- $Model->{$relation} = $bindings;
- unset($Model->__backContainableAssociation);
- }
- }
- }
-
-/**
* Unbinds all relations from a model except the specified ones. Calling this function without
* parameters unbinds all related models.
*

0 comments on commit ac0b2b8

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