2009-01-21 21:25:05 +03:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\ORM\Query\AST;
|
|
|
|
|
2009-01-21 21:25:05 +03:00
|
|
|
/**
|
|
|
|
* LikeExpression ::= StringExpression ["NOT"] "LIKE" string ["ESCAPE" char]
|
|
|
|
*
|
|
|
|
* @author robo
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
class LikeExpression extends Node
|
2009-01-21 21:25:05 +03:00
|
|
|
{
|
|
|
|
private $_stringExpr;
|
|
|
|
private $_isNot;
|
|
|
|
private $_stringPattern;
|
|
|
|
private $_escapeChar;
|
|
|
|
|
|
|
|
public function __construct($stringExpr, $stringPattern, $isNot = false, $escapeChar = null)
|
|
|
|
{
|
|
|
|
$this->_stringExpr = $stringExpr;
|
|
|
|
$this->_stringPattern = $stringPattern;
|
|
|
|
$this->_isNot = $isNot;
|
|
|
|
$this->_escapeChar = $escapeChar;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isNot()
|
|
|
|
{
|
|
|
|
return $this->_isNot;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getStringExpression()
|
|
|
|
{
|
|
|
|
return $this->_stringExpr;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getStringPattern()
|
|
|
|
{
|
|
|
|
return $this->_stringPattern;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getEscapeChar()
|
|
|
|
{
|
|
|
|
return $this->_escapeChar;
|
|
|
|
}
|
2009-03-23 20:39:33 +03:00
|
|
|
|
|
|
|
public function dispatch($sqlWalker)
|
|
|
|
{
|
|
|
|
return $sqlWalker->walkLikeExpression($this);
|
|
|
|
}
|
2009-02-20 08:46:20 +03:00
|
|
|
}
|