Browse Source

soft delete behavior fix

euromark 12 years ago
parent
commit
8c91238237
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Model/Behavior/SoftDeleteBehavior.php

+ 3 - 3
Model/Behavior/SoftDeleteBehavior.php

@@ -142,7 +142,7 @@ class SoftDeleteBehavior extends ModelBehavior {
 		$data = array();
 		$fields = $this->_normalizeFields($model);
 		foreach ($fields as $flag => $date) {
-			if (true === $runtime || $flag === $runtime) {
+			if ($runtime === true || $flag === $runtime) {
 				$data[$flag] = true;
 				if ($date) {
 					$data[$date] = date('Y-m-d H:i:s');
@@ -172,7 +172,7 @@ class SoftDeleteBehavior extends ModelBehavior {
 		$data = array();
 		$fields = $this->_normalizeFields($model);
 		foreach ($fields as $flag => $date) {
-			if (true === $runtime || $flag === $runtime) {
+			if ($runtime === true || $flag === $runtime) {
 				$data[$flag] = false;
 				if ($date) {
 					$data[$date] = null;
@@ -317,7 +317,7 @@ class SoftDeleteBehavior extends ModelBehavior {
 						continue;
 					}
 
-					$conditions = $model->{$parentModel}->{$assocType}[$assoc]['conditions'];
+					$conditions =& $model->{$parentModel}->{$assocType}[$assoc]['conditions'];
 					if (!is_array($conditions)) {
 						$model->{$parentModel}->{$assocType}[$assoc]['conditions'] = array();
 					}