浏览代码

soft delete behavior fix

euromark 12 年之前
父节点
当前提交
8c91238237
共有 1 个文件被更改,包括 3 次插入3 次删除
  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();
 					}