Skip to content

Commit

Permalink
Little optimization in postConditions of controller.
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information
jrbasso authored and markstory committed Nov 21, 2009
1 parent 1c0c1bc commit 1cef0ac
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cake/libs/controller/controller.php
Expand Up @@ -899,12 +899,14 @@ function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive =
foreach ($fields as $field => $value) {
$key = $model.'.'.$field;
$fieldOp = $op;
if (is_array($op) && array_key_exists($key, $op)) {
$fieldOp = $op[$key];
} elseif (is_array($op) && array_key_exists($field, $op)) {
$fieldOp = $op[$field];
} elseif (is_array($op)) {
$fieldOp = false;
if (is_array($op)) {
if (array_key_exists($key, $op)) {
$fieldOp = $op[$key];
} elseif (array_key_exists($field, $op)) {
$fieldOp = $op[$field];
} else {
$fieldOp = false;
}
}
if ($exclusive && $fieldOp === false) {
continue;
Expand Down

0 comments on commit 1cef0ac

Please sign in to comment.