private function configureDatabase() { if ($this->configure->isDataBaseActive()) { $host = $this->configure->getDataBaseHost(); $user = $this->configure->getDataBaseUser(); $pass = $this->configure->getDataBasePass(); $schema = $this->configure->getDataBaseSchm(); Ibe_Database::open($host, $user, $pass, $schema); } }
/** * Seta uma nova conexao mysql * @param resource_mysql $mysql_connection */ public static function setConn($mysql_connection) { self::$conn = $mysql_connection; }
/** * Executa a query * @return array de resultados */ public function execute($mount_array = true, $query = NULL) { if (Ibe_Database::getConn()) { if (!isset($query) || !is_string($query)) { $query = $this->getQuery(); } $result = Ibe_Database::execute($query); if ($mount_array) { $array_results = array(); while ($obj = mysql_fetch_object($result)) { $array_results[] = $obj; } } else { $array_results = $result; } } else { throw new Ibe_Exception(Ibe_Exception::ERRO_MYSQL); } return $array_results; }
public function __construct($name = null) { $this->conn_link = isset($name) ? $name : Ibe_Database::getConn(); }