expr() public méthode

Returns new dynamic query and initializes it to use specific template.
public expr ( string $expr, array $tags = [] ) : DB_dsql
$expr string SQL Expression. Don't pass unverified input
$tags array Array of tags and values. @see setCustom()
Résultat DB_dsql New dynamic query, won't affect $this
Exemple #1
0
 /** Initializes base query for this model.
  * @link http://agiletoolkit.org/doc/modeltable/dsql */
 public function initQuery()
 {
     if (!$this->table) {
         throw $this->exception('$table property must be defined');
     }
     $this->dsql = $this->db->dsql();
     $this->dsql->debug($this->debug);
     $this->dsql->table($this->table, $this->table_alias);
     $this->dsql->default_field = $this->dsql->expr('*,' . $this->dsql->bt($this->table_alias ?: $this->table) . '.' . $this->dsql->bt($this->id_field));
     $this->dsql->id_field = $this->id_field;
     return $this;
 }