added isNotNull support
This commit is contained in:
parent
7f8fc2bec1
commit
e33bd03aa8
@ -565,6 +565,24 @@ class Doctrine_Expression extends Doctrine_Connection_Module {
|
||||
$expression = $this->getIdentifier($expression);
|
||||
return $expression . ' IS NULL';
|
||||
}
|
||||
/**
|
||||
* Returns SQL that checks if a expression is not null.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* $q = new Doctrine_Query();
|
||||
* $q->select('u.*')
|
||||
* ->from('User u')
|
||||
* ->where($q->expr->isNotNull('id'));
|
||||
* </code>
|
||||
*
|
||||
* @param string $expression the expression that should be compared to null
|
||||
* @return string logical expression
|
||||
*/
|
||||
public function isNotNull($expression) {
|
||||
$expression = $this->getIdentifier($expression);
|
||||
return $expression . ' IS NOT NULL';
|
||||
}
|
||||
/**
|
||||
* Returns SQL that checks if an expression evaluates to a value between
|
||||
* two values.
|
||||
|
Loading…
Reference in New Issue
Block a user