/** * Очистка указанной БД от записей */ protected function _reset() { $this->_db_instance->disable_foreign_key_checks(); $tables = DB::query(Database::SELECT, 'SHOW TABLES')->execute($this->_db_instance); foreach ($tables as $table) { $table = array_values($table); $table_name = $table[0]; DB::query(NULL, 'DROP TABLE `:table_name`')->param(':table_name', DB::expr($table_name))->execute($this->_db_instance); } if (file_exists(CFGFATH) !== FALSE) { $this->_write_config_to_file(''); } $this->_db_instance->enable_foreign_key_checks(); }