Skip to content

Instantly share code, notes, and snippets.

@pulponair
Created November 13, 2015 12:12
Show Gist options
  • Save pulponair/c83e7d6b9340d8e81b13 to your computer and use it in GitHub Desktop.
Save pulponair/c83e7d6b9340d8e81b13 to your computer and use it in GitHub Desktop.
$constrains = array();
$query = $this->createQuery();
if ($wtf = $demand->getWhatver()) {
constrains[] = $query->equals('title', $wtf);
}
if ....
usw.
$query->matching($query->logicalAnd(
$constrains
))
return $query->execute();
@pulponair
Copy link
Author

equals($propertyName, $operand, $caseSensitive = TRUE)
in($propertyName, $operand)
contains($propertyName, $operand)
like($propertyName, $operand)
lessThan($propertyName, $operand)
lessThanOrEqual($propertyName, $operand)
greaterThan($propertyName, $operand)
greaterThanOrEqual($propertyName, $operand)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment