Exemple #1
0
 /**
  *
  * @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 = "";
 }
Exemple #2
0
 /**
  * @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 = '';
 }
Exemple #3
0
 /**
  * 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();
     }
 }
Exemple #4
0
 public function __construct($tabela = "", $values = array())
 {
     parent::__construct($tabela);
     $this->values($values);
 }
Exemple #5
0
 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();
 }