public function restoreConditions() { if (!$this->model) { // adding new model if ($this->table_alias) { $this->model = $this->add($this->model_name, array('table_alias' => $this->table_alias)); } else { $this->model = $this->add($this->model_name); } $this->saveConditions(); } /** @type SQL_Model $this->model */ $this->model->_dsql()->args['where'] = $this->orig_conditions; return $this; }
public function fieldExpr($f) { return $this->owner->_dsql()->expr($this->owner->_dsql()->bt($this->short_name) . '.' . $this->owner->_dsql()->bt($f)); }
/** * Returns field of this model. * * @return string */ public function getExpr() { $q = $this->owner->_dsql(); return $q->bt($this->relation ? $this->relation->short_name : $q->main_table) . '.' . $q->bt($this->actual_field ?: $this->short_name); }