Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless else after return #284

Merged
merged 1 commit into from
Jul 30, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions src/Propel/Runtime/Query/ModelCriteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -1866,20 +1866,17 @@ protected function getCriterionForClause($clause, $value, $bindingType = null)
if (substr_count($clause, '?') > 1) {
return new SeveralModelCriterion($this, $clause, $colMap, $value, $this->currentAlias);
}

return new BasicModelCriterion($this, $clause, $colMap, $value, $this->currentAlias);
} else {
// no column match in clause, must be an expression like '1=1'
if (false !== strpos($clause, '?')) {
if (null === $bindingType) {
throw new PropelException(sprintf('Cannot determine the column to bind to the parameter in clause "%s".', $clause));
}

return new RawCriterion($this, $clause, $value, $bindingType);
}
// no column match in clause, must be an expression like '1=1'
if (false !== strpos($clause, '?')) {
if (null === $bindingType) {
throw new PropelException(sprintf('Cannot determine the column to bind to the parameter in clause "%s".', $clause));
}

return new CustomCriterion($this, null, $clause);
return new RawCriterion($this, $clause, $value, $bindingType);
}

return new CustomCriterion($this, null, $clause);
}

/**
Expand Down