Commit e33bd03a authored by zYne's avatar zYne

added isNotNull support

parent 7f8fc2be
...@@ -565,6 +565,24 @@ class Doctrine_Expression extends Doctrine_Connection_Module { ...@@ -565,6 +565,24 @@ class Doctrine_Expression extends Doctrine_Connection_Module {
$expression = $this->getIdentifier($expression); $expression = $this->getIdentifier($expression);
return $expression . ' IS NULL'; 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 * Returns SQL that checks if an expression evaluates to a value between
* two values. * two values.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment