/** * * @param string $tabela Define a tabela onde a consulta será feita */ public function __construct($tabela = "") { parent::__construct($tabela); $this->where = new Where(); $this->distinct = $this->colunas = $this->inner = $this->order = ""; $this->limit = $this->group = ""; }
/** * @param string $tabela Define a tabela onde a consulta será feita */ public function __construct($tabela = '') { if (String::validarTipo($tabela)) { parent::__construct($tabela); } elseif (is_array($tabela)) { $this->from($tabela); } $this->where = new Where(); $this->inner = new Join(); $this->colunas = array(); $this->distinct = $this->order = ''; $this->limit = $this->group = ''; }
/** * Construtor * @param string $tabela A tabela a ter o=um item deletado * @param Where|string $where O teste para a exclusão */ public function __construct($tabela = false, Where $where = null) { if (is_string($tabela)) { parent::__construct($tabela); $this->setTabela($tabela); } else { $this->tabela = ""; } if ($where) { $this->where($where); } else { $this->where = new Where(); } }
public function __construct($tabela = "", $values = array()) { parent::__construct($tabela); $this->values($values); }
public function __toString() { if (!count($this->set)) { throw new SqlException("Não foram definidas as colunas para a atualização"); } $this->queryString = "UPDATE {$this->tabela} SET "; foreach (array_keys($this->set) as $coluna) { $this->queryString .= "{$coluna} = :{$coluna}, "; } $this->queryString = substr($this->queryString, 0, -2); $this->queryString .= " {$this->where} "; return parent::__toString(); }