/** * <b>Não é passado com os Joins</b> * * @return array[Objetos] */ public function findAll() { $sql = "SELECT * FROM {$this->Table}"; $this->Stmt = Conn::prepare($sql); $this->Stmt->execute(); return $this->Stmt->fetchAll(); }
/** * Recebe a mensagem de erro e cria o banco de dados por demanda. * * @param string $msg */ public static function BDCREATE($msg) { if (strpos($msg, "ws_categories") || strpos($msg, "ws_posts") || strpos($msg, "ws_posts_gallery") || strpos($msg, "ws_siteviews") || strpos($msg, "ws_siteviews_agent") || strpos($msg, "ws_siteviews_online") || strpos($msg, "ws_users")) { $tab = 'framework'; } elseif (strpos($msg, "app_youtube")) { $tab = 'aplicacao'; } elseif (strpos($msg, "app_cidades")) { $tab = 'cidades'; } elseif (strpos($msg, "app_estados")) { $tab = 'estados'; } elseif (strpos($msg, "app_cidades")) { $tab = 'cidades'; } if (!empty($tab)) { $file = file_get_contents(HOME . "/createbd/{$tab}.sql"); try { $stmt = Conn::prepare($file); $stmt->execute(); } catch (Exception $ex) { WSErro("Erro ao criar banco de dados [{$ex}]", WS_ERROR); } } }
/** * Recebe a mensagem de erro e cria o banco de dados por demanda. * * @param string $msg */ public static function BDCREATE($msg) { if (strpos($msg, "ws_setor_type") || strpos($msg, "ws_setor") || strpos($msg, "app_youtube") || strpos($msg, "app_niver") || strpos($msg, "ws_categories") || strpos($msg, "ws_posts") || strpos($msg, "ws_posts_gallery") || strpos($msg, "ws_siteviews") || strpos($msg, "ws_siteviews_agent") || strpos($msg, "ws_siteviews_online") || strpos($msg, "ws_users") || strpos($msg, "app_cidades") || strpos($msg, "app_estados")) { $tab = 'framework'; } elseif (strpos($msg, "agenda_contatos") || strpos($msg, "agenda_endereco") || strpos($msg, "agenda_endereco")) { $tab = 'agenda'; } elseif (strpos($msg, "imp_postos") || strpos($msg, "imp_contadores") || strpos($msg, "imp_impressora") || strpos($msg, "imp_modelo") || strpos($msg, "imp_taxa_impress")) { $tab = 'plugin_impress'; } elseif (strpos($msg, "fe_exames") || strpos($msg, "fe_material") || strpos($msg, "fe_acoes")) { $tab = 'plugin_fast_exames'; } elseif (strpos($msg, "dt_downtime") || strpos($msg, "dt_equipamentos")) { $tab = 'downtime'; } if (!empty($tab)) { $file = file_get_contents(HOME . "/createbd/{$tab}.sql"); try { $stmt = Conn::prepare($file); $stmt->execute(); } catch (Exception $ex) { WSErro("Erro ao criar banco de dados [{$ex}]", WS_ERROR); } } }
protected function Execute($Sql) { $this->Stmt = Conn::prepare($Sql); if ($this->Dados && array_key_exists('limit', $this->Dados)) { $Limit = (int) $this->Dados['limit']; $this->Stmt->bindParam(':limit', $Limit, PDO::PARAM_INT); unset($this->Dados['limit']); } if ($this->Dados && array_key_exists('offset', $this->Dados)) { $Offset = (int) $this->Dados['offset']; $this->Stmt->bindParam(':offset', $Offset, PDO::PARAM_INT); unset($this->Dados['offset']); } if ($this->BindParam) { foreach ($this->Dados as $dado => $value) { $this->Stmt->bindParam(":{$dado}", $value); } $this->Dados = null; } }