_dsql() public method

This will initialize $dsql property if it does not exist yet.
public _dsql ( ) : DB_dsql
return DB_dsql
Example #1
0
File: Many.php Project: atk4/atk4
 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;
 }
Example #2
0
 public function fieldExpr($f)
 {
     return $this->owner->_dsql()->expr($this->owner->_dsql()->bt($this->short_name) . '.' . $this->owner->_dsql()->bt($f));
 }
Example #3
0
File: Field.php Project: atk4/atk4
 /**
  * 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);
 }