. */ /** * NullComparisonExpression = "IS" ["NOT"] "NULL" * * @package Doctrine * @subpackage Query * @author Guilherme Blanco * @author Janne Vanhala * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class Doctrine_Query_Production_NullComparisonExpression extends Doctrine_Query_Production { protected $_not; public function syntax($paramHolder) { $this->_not = false; $this->_parser->match(Doctrine_Query_Token::T_IS); if ($this->_isNextToken(Doctrine_Query_Token::T_NOT)) { $this->_parser->match(Doctrine_Query_Token::T_NOT); $this->_not = true; } $this->_parser->match(Doctrine_Query_Token::T_NULL); } public function buildSql() { return 'IS ' . (($this->_not) ? 'NOT ' : '') . 'NULL'; } /** * Visitor support * * @param object $visitor */ public function accept($visitor) { $visitor->visitNullComparisonExpression($this); } /* Getters */ public function isNot() { return $this->_not; } }