public function getStatement($criteria) { $s = criteria::getOperand($this->attribute, $criteria)->getSqlOrder(); $s .= $this->ascend ? ' ASC' : ' DESC'; return $s; }
public function __construct($operand, $criteria) { parent::__construct($operand); $this->type = 'public function'; $str = $this->argument = $this->operand; $separator = "+-/*,()"; $tok = strtok($str, $separator); while ($tok) { $t[$tok] = $tok; $tok = strtok($separator); } foreach ($t as $token) { $op = criteria::getOperand($token, $criteria); if (get_class($op) == 'OperandValue') { $op = criteria::getOperand(':' . $token, $criteria); } $this->argument = str_replace($token, $op->getSql(), $this->argument); } }