Merge branch 'DDC-1012'
This commit is contained in:
commit
a18a7bb678
@ -443,6 +443,28 @@ class Expr
|
|||||||
return new Expr\Func($x . ' NOT IN', (array) $y);
|
return new Expr\Func($x . ' NOT IN', (array) $y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an IS NULL expression with the given arguments.
|
||||||
|
*
|
||||||
|
* @param string $x Field in string format to be restricted by IS NULL
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function isNull($x)
|
||||||
|
{
|
||||||
|
return $x . ' IS NULL';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an IS NOT NULL expression with the given arguments.
|
||||||
|
*
|
||||||
|
* @param string $x Field in string format to be restricted by IS NOT NULL
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function isNotNull($x)
|
||||||
|
{
|
||||||
|
return $x . ' IS NOT NULL';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a LIKE() comparison expression with the given arguments.
|
* Creates a LIKE() comparison expression with the given arguments.
|
||||||
*
|
*
|
||||||
|
@ -256,6 +256,16 @@ class ExprTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
$this->assertEquals('TRIM(u.id)', (string) $this->_expr->trim('u.id'));
|
$this->assertEquals('TRIM(u.id)', (string) $this->_expr->trim('u.id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testIsNullExpr()
|
||||||
|
{
|
||||||
|
$this->assertEquals('u.id IS NULL', (string) $this->_expr->isNull('u.id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testIsNotNullExpr()
|
||||||
|
{
|
||||||
|
$this->assertEquals('u.id IS NOT NULL', (string) $this->_expr->isNotNull('u.id'));
|
||||||
|
}
|
||||||
|
|
||||||
public function testInExpr()
|
public function testInExpr()
|
||||||
{
|
{
|
||||||
$this->assertEquals('u.id IN(1, 2, 3)', (string) $this->_expr->in('u.id', array(1, 2, 3)));
|
$this->assertEquals('u.id IN(1, 2, 3)', (string) $this->_expr->in('u.id', array(1, 2, 3)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user