// if field not set, builds template from sqlForPath and comparator(Id)
function () {
if ($this->sqlTemplate) return $this->sqlTemplate;
$template = '';
$comp = $this->('comparator');
if (!$comp) throw new PntError('No comparator '. Gen::toString($this));
$sqlOperator = $comp->();
if ($sqlOperator == '=' && $this->value1 === null)
$sqlOperator = 'IS';
if ($sqlOperator == '!=' && $this->value1 === null)
$sqlOperator = 'IS NOT';
if ($comp && ($comparatorPreceder = $comp->('preceder')) )
$template .= "$comparatorPreceder ";
$template .= "(\$columnName $sqlOperator ?";
if ($comp && ($comparatorAddition = $comp->('addition')) )
$template .= " $comparatorAddition ?";
$template .= ")";
return $template;
}
|