|
noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
|
This class allow you to connect to the postgresql database, execute sql, retrieve data. More...
Inheritance diagram for DatabaseCore:
Collaboration diagram for DatabaseCore:Public Member Functions | |
| __construct ($p_user, $p_password, $p_dbname, $p_host, $p_port) | |
| !< $dbuser(string) Database user | |
| __toString () | |
| alter_seq ($p_name, $min) | |
| alter the sequence value | |
| clean_orphan_lob () | |
| Find all lob and remove those which are not used by any tables. | |
| clear_all_prepare () | |
| clear all prepare stmt | |
| clear_prepare ($sql_name) | |
| clear a prepare stmt | |
| close () | |
| wrapper for the function pg_close | |
| commit () | |
| Commit the transaction. | |
| count ($p_ret=null) | |
| synomym for size() | |
| count_sql ($p_sql, $p_array=null) | |
| Count the number of row returned by a sql statement. | |
| create_sequence ($p_name, $min=1) | |
| Create a sequence. | |
| exec_sql ($p_string, $p_array=null) | |
| send a sql string to the database | |
| execute ($p_string, $p_array) | |
| wrapper for the function pg_execute | |
| execute_script ($script) | |
| Execute a sql script. | |
| exist_blob ($p_oid) | |
| check if the large object exists | |
| exist_column ($col, $table, $schema) | |
| Check if a column exists in a table. | |
| exist_database ($p_name) | |
| Count the database name in a system view. | |
| exist_schema ($p_name) | |
| test if a schema exists | |
| exist_sequence ($p_name) | |
| test if a sequence exist | |
| exist_table ($p_name, $p_schema='public') | |
| test if a table exist | |
| exist_view ($p_name) | |
| fetch ($p_indice, $p_mode=PGSQL_ASSOC) | |
| fetch the $p_indice array from the last query | |
| get_affected () | |
| return the number of rows affected by the previous query | |
| get_array ($p_sql, $p_array=null, $p_mode=PGSQL_ASSOC) | |
| purpose return the result of a sql statment in a array | |
| get_current_seq ($p_seq) | |
| get the current sequence value | |
| get_db () | |
| get_dbhost () | |
| get_dbname () | |
| get_dbport () | |
| get_dbuser () | |
| get_encoding () | |
| get_is_open () | |
| get_name () | |
| return the name of the current database | |
| get_next_seq ($p_seq) | |
| get the next sequence value | |
| get_ret () | |
| get_row ($p_sql, $p_array=NULL) | |
| Returns only one row from a query. | |
| get_sql () | |
| last SQL stmt executed | |
| get_value ($p_sql, $p_array=null) | |
| return the value of the sql, the sql will return only one value with the value | |
| is_prepare ($query_name) | |
| Check if a prepared statement already exists or not. | |
| lo_export ($p_oid, $tmp_file) | |
| wrapper for the function pg_lo_export | |
| lo_import ($p_filename) | |
| wrapper for the function pg_lo_export | |
| lo_read ($oid) | |
| read a Large object with data content in a binary | |
| lo_replace ($binary_data, $oid) | |
| replace a Large object with data content in a binary | |
| lo_unlink ($p_oid) | |
| wrapper for the function pg_lo_unlink | |
| lo_write ($binary_data) | |
| large_object writee: create a Large object if oid is not given with data content in a binaray | |
| make_array ($p_sql, $p_null=0, $p_array=null) | |
| make a array with the sql. | |
| make_list ($sql, $p_array=null) | |
| create a string containing the value separated by comma for use in a SQL in statement | |
| prepare ($p_string, $p_sql) | |
| wrapper for the function pg_prepare | |
| query_to_csv ($ret, $aheader) | |
| with the handle of a successull query, echo each row into CSV and send it directly to output. | |
| rollback () | |
| rollback the current transaction | |
| search_sql_inject ($p_sql) | |
| FInd if a SQL Select has a SQL stmt to inject or damage Data When a SELECT SQL string is build, this string could contain a SQL attempt to damage data, so the statement DELETE TRUNCATE ... are forbidden. | |
| set_db ($db) | |
| set_encoding ($p_charset) | |
| set_is_open ($is_open) | |
| set_ret ($ret) | |
| set_sql ($sql) | |
| last SQL stmt executed | |
| size ($p_ret=null) | |
| return the number of rows found by the last query, or the number of rows from $p_ret | |
| start () | |
| : start a transaction | |
| status () | |
| get the transaction status : The status can be | |
| upload ($p_name, $only_oid=false) | |
| Save one or several documents into the database , it just puts the file in the database and returns the corresponding OID , the mimetype , size ... of the document must be set in the calling function. | |
| verify () | |
Static Public Member Functions | |
| static | escape_string ($p_string) |
| wrapper for the function pg_escape_string | |
| static | fetch_all ($ret, $p_mode=PGSQL_ASSOC) |
| wrapper for the function pg_fetch_all | |
| static | fetch_array ($ret, $p_indice=0, $p_mode=PGSQL_ASSOC) |
| wrapper for the function pg_fetch_array | |
| static | fetch_result ($ret, $p_row=0, $p_col=0) |
| wrapper for the function pg_fetch_all | |
| static | fetch_row ($ret, $p_row) |
| wrapper for the function pg_fetch_row | |
| static | nb_column ($p_ret) |
| Returns the number of columns in a ret. | |
| static | num_row ($ret) |
| wrapper for the function pg_num_rows | |
| static | test_me () |
Data Fields | |
| $array | |
| $sql | |
| last SQL stmt executed | |
Protected Attributes | |
| $db | |
| database connection | |
| $dbhost | |
| !< $dbport (int) Database port | |
| $dbname | |
| $dbport | |
| !< $dbname (string) Database name | |
| $dbuser | |
| !< $dbhost(string) Database host | |
| $is_open | |
| $ret | |
| return value | |
This class allow you to connect to the postgresql database, execute sql, retrieve data.
Definition at line 35 of file database_core.class.php.
| DatabaseCore::__construct | ( | $p_user, | |
| $p_password, | |||
| $p_dbname, | |||
| $p_host, | |||
| $p_port ) |
!< $dbuser(string) Database user
Connect to a database return an connx to db or false if it fails
| string | $p_user | Username |
| type | $p_password | User's password |
| $p_dbname | name of the database to connect | |
| type | $p_host | Host of DB |
| type | $p_port | Port of DB |
Definition at line 59 of file database_core.class.php.
| DatabaseCore::__toString | ( | ) |
return
Reimplemented in Database.
Definition at line 1009 of file database_core.class.php.
| DatabaseCore::alter_seq | ( | $p_name, | |
| $min ) |
alter the sequence value
| $p_name | name of the sequence |
| $min | the start value of the sequence |
Definition at line 315 of file database_core.class.php.
References $min, $Res, and exec_sql().
Referenced by Database\apply_patch().
Here is the call graph for this function:| DatabaseCore::clean_orphan_lob | ( | ) |
Find all lob and remove those which are not used by any tables.
Definition at line 1040 of file database_core.class.php.
References $check, $i, $sql, count(), get_array(), get_value(), and lo_unlink().
Here is the call graph for this function:| DatabaseCore::clear_all_prepare | ( | ) |
| DatabaseCore::clear_prepare | ( | $sql_name | ) |
clear a prepare stmt
| $sql_name | name of the prepare SQL |
Definition at line 1161 of file database_core.class.php.
References db, and escape_string().
Here is the call graph for this function:| DatabaseCore::close | ( | ) |
wrapper for the function pg_close
Definition at line 995 of file database_core.class.php.
References db.
| DatabaseCore::commit | ( | ) |
Commit the transaction.
Definition at line 295 of file database_core.class.php.
References $Res, and exec_sql().
Referenced by lo_read(), lo_replace(), lo_write(), and upload().
Here is the call graph for this function:| DatabaseCore::count | ( | $p_ret = null | ) |
synomym for size()
Definition at line 441 of file database_core.class.php.
References size.
Referenced by clean_orphan_lob(), Card_Property\get_attribute(), get_row(), make_list(), and query_to_csv().
| DatabaseCore::count_sql | ( | $p_sql, | |
| $p_array = null ) |
Count the number of row returned by a sql statement.
| $p_sql | sql string |
| $p_array | if not null we use the safer pg_query_params |
Definition at line 255 of file database_core.class.php.
References $p_array, and exec_sql().
Referenced by exist_schema(), exist_sequence(), exist_table(), and exist_view().
Here is the call graph for this function:| DatabaseCore::create_sequence | ( | $p_name, | |
| $min = 1 ) |
Create a sequence.
| string | $p_name | Sequence Name |
| int | $min | starting value |
Definition at line 527 of file database_core.class.php.
References $min, $sql, and exec_sql().
Here is the call graph for this function:
|
static |
wrapper for the function pg_escape_string
| $p_string | is the string to escape |
Definition at line 984 of file database_core.class.php.
References $cn.
Referenced by clear_prepare(), Acc_Ledger_Search\list_operation(), Anc_Acc_List\load_anc_account(), Anc_Acc_List\load_anc_card(), Anc_Acc_List\load_card(), Anc_Table\load_card(), Anc_Acc_List\load_poste(), Anc_Table\load_poste(), Follow_Up\myList(), and Noalyss_User\set_session_var().
| DatabaseCore::exec_sql | ( | $p_string, | |
| $p_array = null ) |
send a sql string to the database
| $p_string | sql string |
| $p_array | array for the SQL string (see pg_query_params) |
Definition at line 203 of file database_core.class.php.
References $a, $p_array, $ret, _, db, record_log(), and rollback().
Referenced by Database\__construct(), alter_seq(), Database\apply_patch(), Extension\clean(), commit(), count_sql(), create_sequence(), execute_script(), get_array(), get_next_seq(), get_value(), Sendmail\increment_mail(), make_array(), rollback(), and start().
Here is the call graph for this function:| DatabaseCore::execute | ( | $p_string, | |
| $p_array ) |
wrapper for the function pg_execute
| $p_string | string name of the stmt given in pg_prepare function |
| $p_array | contains the variables |
Definition at line 948 of file database_core.class.php.
| DatabaseCore::execute_script | ( | $script | ) |
Execute a sql script.
| $script | script name |
Definition at line 327 of file database_core.class.php.
References $script, $sql, exec_sql(), print, and rollback().
Referenced by Database\apply_patch().
Here is the call graph for this function:| DatabaseCore::exist_blob | ( | $p_oid | ) |
check if the large object exists
| $p_oid | of the large object |
Definition at line 596 of file database_core.class.php.
References $r, and get_value().
Referenced by lo_unlink().
Here is the call graph for this function:| DatabaseCore::exist_column | ( | $col, | |
| $table, | |||
| $schema ) |
Check if a column exists in a table.
| $col | : column name |
| $table | :table name |
| $schema | :schema name, default public |
Definition at line 570 of file database_core.class.php.
References $r, $table, and get_value().
Here is the call graph for this function:| DatabaseCore::exist_database | ( | $p_name | ) |
Count the database name in a system view.
| $p_name | string database name |
Definition at line 584 of file database_core.class.php.
References get_value().
Here is the call graph for this function:| DatabaseCore::exist_schema | ( | $p_name | ) |
test if a schema exists
Definition at line 624 of file database_core.class.php.
References $r, and count_sql().
Referenced by Database\__construct(), Database\apply_patch(), and Extension\clean().
Here is the call graph for this function:| DatabaseCore::exist_sequence | ( | $p_name | ) |
test if a sequence exist
Definition at line 540 of file database_core.class.php.
References $r, and count_sql().
Here is the call graph for this function:| DatabaseCore::exist_table | ( | $p_name, | |
| $p_schema = 'public' ) |
test if a table exist
| $p_name | table name |
| $schema | name of the schema default public |
Definition at line 555 of file database_core.class.php.
References $r, and count_sql().
Referenced by Database\apply_patch().
Here is the call graph for this function:| DatabaseCore::exist_view | ( | $p_name | ) |
Definition at line 611 of file database_core.class.php.
References $r, and count_sql().
Here is the call graph for this function:| DatabaseCore::fetch | ( | $p_indice, | |
| $p_mode = PGSQL_ASSOC ) |
fetch the $p_indice array from the last query
| $p_mode | is PGSQL_ASSOC, PGSQL_BOTH or PGSQL_NUM (default PGSQL_ASSOC) |
| $p_indice | index |
Definition at line 413 of file database_core.class.php.
|
static |
wrapper for the function pg_fetch_all
| $ret | is the result of pg_exec (exec_sql) |
| $p_mode | is PGSQL_ASSOC, PGSQL_BOTH or PGSQL_NUM (default PGSQL_ASSOC) |
Definition at line 888 of file database_core.class.php.
References $ret.
Referenced by Acc_Ledger_History\add_additional_tax_info(), Acc_Ledger_History_Purchase\add_vat_info(), Acc_Ledger_History_Sale\add_vat_info(), Fiche\belong_ledger(), Follow_Up\get(), Table_Data_SQL\get_all_to_array(), Anc_Operation\get_balance(), Acc_Ledger\get_class_def(), Acc_Ledger_History_Generic\get_detail(), Acc_Ledger\get_fiche_def(), Anc_Operation\get_jrid(), Acc_Operation\get_jrnx_detail(), Acc_Report\get_list(), Anc_Operation\get_list(), Anc_Plan\get_list(), Pre_operation\get_list_ledger(), Fiche\get_quick_code(), Acc_Ledger_History_Generic\get_row(), Acc_Account_Ledger\get_row_date(), Acc_Ledger_History_Generic\get_rowSimple(), Acc_Ledger\get_solde(), Fiche\getName(), Acc_Account_Ledger\load(), Anc_Balance_Simple\load(), Pre_op_ach\load(), Pre_Op_Advanced\load(), Pre_op_fin\load(), Pre_op_ods\load(), Pre_op_ven\load(), Pre_operation\load(), Acc_Ledger_Info\load_all(), Acc_Parm_Code\load_all(), Todo_List\load_all(), Anc_Group\myList(), Document_Modele\myList(), Follow_Up\myList(), Follow_Up\short_list(), and Customer\VatListing().
|
static |
wrapper for the function pg_fetch_array
| $ret | is the result of a pg_exec |
| $p_indice | is the index |
| $p_mode | is PGSQL_ASSOC, PGSQL_BOTH or PGSQL_NUM (default PGSQL_ASSOC) |
Definition at line 876 of file database_core.class.php.
References $ret.
Referenced by Noalyss_Parameter_Folder\__construct(), Card_Property\build_input(), Noalyss_User\Check(), Document_Modele\Delete(), Manage_Table_SQL\display_table(), Periode_Ledger_Table\display_table(), Fiche_Def\DisplayAttribut(), Print_Ledger_Detail_Item\export(), Print_Ledger_Simple\export(), Print_Ledger_Simple_Without_Vat\export(), Acc_Ledger_History_Purchase\export_csv(), Acc_Ledger_History_Sale\export_csv(), Follow_Up\export_csv_detail(), Document\export_file(), Acc_Operation\find_tiers(), Acc_Reconciliation\get(), Anc_Plan\get(), Document\get(), Fiche_Def\get(), Fiche_Def\get_all(), Acc_Reconciliation\get_amount_noautovat(), Fiche_Def\get_attr_min(), Fiche\get_bk_balance(), Customer\get_by_account(), Supplier\get_by_account(), Fiche\get_by_category(), Fiche_Def\get_by_category(), Acc_Operation\get_data(), Periode\get_date_limit(), Acc_Operation\get_internal(), Acc_Account_Ledger\get_name(), Acc_Ledger\get_name(), Acc_Report\get_row(), Fiche\get_row_result_deprecated(), Acc_Account_Ledger\get_row_sql_deprecated(), Acc_Account_Ledger\get_solde(), Acc_Account_Ledger\get_solde_detail(), Fiche\get_solde_detail(), Acc_Ledger\get_type(), html_min_page_start(), html_page_start(), isValid_deprecrated(), Acc_Ledger_Search\list_operation(), Acc_Ledger_Search\list_operation_to_reconcile(), Acc_Ledger\listing(), Acc_Bilan\load(), Acc_Ledger_Info\load(), Acc_Parm_Code\load(), Acc_Payment\load(), Anc_Group\load(), Card_Property\load(), Dossier\load(), Noalyss_User\load(), Todo_List\load(), Fiche_Def\load_attribute(), Fiche_Def\myList(), query_to_csv(), Document_Modele\Save(), Document\send(), Profile_Menu\sub_menu(), Card_Property\update(), Document_Modele\update(), Anc_Operation\update_from_jrnx(), Dossier\upgrade(), Customer\VatListing(), Acc_Bilan\verify(), and Acc_Bilan\warning().
|
static |
wrapper for the function pg_fetch_all
| $ret | is the result of pg_exec (exec_sql) |
| $p_row | is the indice of the row |
| $p_col | is the indice of the col |
Definition at line 901 of file database_core.class.php.
Referenced by Fiche\empty_attribute(), Print_Ledger_Financial\export(), Periode\find_periode(), Periode\get_exercice(), Acc_Account_Ledger\get_row(), Fiche\get_row(), Fiche\get_row_date(), Acc_Ledger_Info\insert(), Todo_List\insert(), Periode\is_centralized(), Acc_Ledger_Info\search_id_internal(), and Acc_Operation\seek_internal().
|
static |
wrapper for the function pg_fetch_row
| $ret | is the result of pg_exec (exec_sql) |
| $p_row | is the indice of the row |
Definition at line 912 of file database_core.class.php.
References $ret.
Referenced by Html_Table\sql2table().
| DatabaseCore::get_affected | ( | ) |
return the number of rows affected by the previous query
Definition at line 483 of file database_core.class.php.
References num_row().
Here is the call graph for this function:| DatabaseCore::get_array | ( | $p_sql, | |
| $p_array = null, | |||
| $p_mode = PGSQL_ASSOC ) |
purpose return the result of a sql statment in a array
| $p_sql | sql query |
| $p_array | if not null we use ExecSqlParam |
| $p_mode | is PGSQL_ASSOC, PGSQL_BOTH or PGSQL_NUM (default PGSQL_ASSOC) |
Definition at line 497 of file database_core.class.php.
References $array, $p_array, $r, and exec_sql().
Referenced by clean_orphan_lob(), get_row(), and make_list().
Here is the call graph for this function:| DatabaseCore::get_current_seq | ( | $p_seq | ) |
get the current sequence value
Definition at line 265 of file database_core.class.php.
References $Res, and get_value().
Here is the call graph for this function:| DatabaseCore::get_db | ( | ) |
| DatabaseCore::get_dbhost | ( | ) |
| DatabaseCore::get_dbname | ( | ) |
Definition at line 90 of file database_core.class.php.
References $dbname.
Referenced by Database\__toString().
| DatabaseCore::get_dbport | ( | ) |
| DatabaseCore::get_dbuser | ( | ) |
| DatabaseCore::get_encoding | ( | ) |
Definition at line 124 of file database_core.class.php.
References db.
| DatabaseCore::get_is_open | ( | ) |
Definition at line 165 of file database_core.class.php.
References $is_open.
| DatabaseCore::get_name | ( | ) |
return the name of the current database
Definition at line 110 of file database_core.class.php.
References db.
| DatabaseCore::get_next_seq | ( | $p_seq | ) |
get the next sequence value
Definition at line 275 of file database_core.class.php.
References $Res, $seq, and exec_sql().
Here is the call graph for this function:| DatabaseCore::get_ret | ( | ) |
| DatabaseCore::get_row | ( | $p_sql, | |
| $p_array = NULL ) |
Returns only one row from a query.
| string | $p_sql | |
| array | $p_array |
| Exception | if too many rows are found code 100 |
Definition at line 514 of file database_core.class.php.
References $array, $p_array, _, count(), and get_array().
Here is the call graph for this function:| DatabaseCore::get_sql | ( | ) |
last SQL stmt executed
| string | $sql |
Definition at line 181 of file database_core.class.php.
References $sql.
| DatabaseCore::get_value | ( | $p_sql, | |
| $p_array = null ) |
return the value of the sql, the sql will return only one value with the value
| $p_sql | the sql stmt example :select s_value from document_state where s_id=2 |
| $p_array | if array is not null we use the ExecSqlParm (safer) |
Definition at line 460 of file database_core.class.php.
References $array, $ex, $p_array, $r, and exec_sql().
Referenced by Acc_Account\__construct(), Database\apply_patch(), clean_orphan_lob(), exist_blob(), exist_column(), exist_database(), Card_Property\get_attribute(), get_current_seq(), Sendmail\get_email_sent(), Sendmail\get_max_email(), Database\get_version(), and is_prepare().
Here is the call graph for this function:| DatabaseCore::is_prepare | ( | $query_name | ) |
Check if a prepared statement already exists or not.
| string | $query_name | name of the prepared query |
Definition at line 1083 of file database_core.class.php.
References get_value().
Here is the call graph for this function:| DatabaseCore::lo_export | ( | $p_oid, | |
| $tmp_file ) |
wrapper for the function pg_lo_export
| $p_oid | is the oid of the log |
| $tmp_file | is the file |
Definition at line 961 of file database_core.class.php.
References db.
| DatabaseCore::lo_import | ( | $p_filename | ) |
wrapper for the function pg_lo_export
| $p_filename | is the filename |
| $tmp | is the file |
Definition at line 973 of file database_core.class.php.
References db.
| DatabaseCore::lo_read | ( | $oid | ) |
read a Large object with data content in a binary
| $oid | (int8) oid of the large object |
Definition at line 811 of file database_core.class.php.
References $a, $size, commit(), db, start(), and status().
Here is the call graph for this function:| DatabaseCore::lo_replace | ( | $binary_data, | |
| $oid ) |
replace a Large object with data content in a binary
| $oid | (int8) oid of the large object |
| $binary_data | (raw data) binary |
Definition at line 840 of file database_core.class.php.
References $a, commit(), db, start(), and status().
Here is the call graph for this function:| DatabaseCore::lo_unlink | ( | $p_oid | ) |
wrapper for the function pg_lo_unlink
| $p_oid | is the of oid |
Definition at line 923 of file database_core.class.php.
References db, and exist_blob().
Referenced by clean_orphan_lob().
Here is the call graph for this function:| DatabaseCore::lo_write | ( | $binary_data | ) |
large_object writee: create a Large object if oid is not given with data content in a binaray
| $binary_data | (raw data) binary |
Definition at line 788 of file database_core.class.php.
References $a, commit(), db, start(), and status().
Here is the call graph for this function:| DatabaseCore::make_array | ( | $p_sql, | |
| $p_null = 0, | |||
| $p_array = null ) |
make a array with the sql.
| $p_sql | sql statement, only the first two column will be returned in an array. The first col. is the label and the second the value |
| $p_null | if the array start with a null value Yes = 1 , No=0 |
| $p_array | is the array with the bind value |
* Array * ( * [0] => Array * ( * [value] => 1 * [label] => Marchandise A * ) * * [1] => Array * ( * [value] => 2 * [label] => Marchandise B * ) * * [2] => Array * ( * [value] => 3 * [label] => Marchandise C * ) * ) *
Definition at line 696 of file database_core.class.php.
References $a, $i, $max, $p_array, $r, $row, exec_sql(), and h.
Here is the call graph for this function:| DatabaseCore::make_list | ( | $sql, | |
| $p_array = null ) |
create a string containing the value separated by comma for use in a SQL in statement
Definition at line 639 of file database_core.class.php.
References $f, $i, $idx, $p_array, $ret, $row, $sql, count(), and get_array().
Here is the call graph for this function:
|
static |
Returns the number of columns in a ret.
| handler | $p_ret | handler to a query |
Definition at line 1132 of file database_core.class.php.
|
static |
wrapper for the function pg_num_rows
| $ret | is the result of a exec_sql |
Definition at line 863 of file database_core.class.php.
References $ret.
Referenced by Default_Menu\__construct(), Noalyss_Parameter_Folder\__construct(), Fiche\belong_ledger(), Noalyss_User\Check(), Data_SQL\collect_objects(), Periode\display_periode_global(), Manage_Table_SQL\display_table(), Periode_Ledger_Table\display_table(), Fiche_Def\DisplayAttribut(), Acc_Account_Ledger\do_exist(), Fiche\empty_attribute(), Acc_Report\exist(), Print_Ledger_Detail_Item\export(), Print_Ledger_Simple\export(), Print_Ledger_Simple_Without_Vat\export(), Acc_Ledger_History_Purchase\export_csv(), Acc_Ledger_History_Sale\export_csv(), Follow_Up\export_csv(), Follow_Up\export_csv_detail(), Document\export_file(), Periode\find_periode(), Acc_Operation\find_tiers(), Acc_Reconciliation\get(), Anc_Plan\get(), Document\get(), Fiche_Def\get(), get_affected(), Fiche_Def\get_all(), Acc_Reconciliation\get_amount_noautovat(), Fiche_Def\get_attr_min(), Fiche\get_bk_balance(), Customer\get_by_account(), Supplier\get_by_account(), Fiche\get_by_category(), Fiche_Def\get_by_category(), Acc_Operation\get_data(), Periode\get_date_limit(), Periode\get_exercice(), Acc_Operation\get_internal(), Anc_Operation\get_jrid(), Acc_Operation\get_jrnx_detail(), Acc_Report\get_list(), Acc_Account_Ledger\get_name(), Acc_Ledger\get_name(), Acc_Account_Ledger\get_row(), Acc_Ledger_History_Generic\get_row(), Acc_Report\get_row(), Fiche\get_row(), Fiche\get_row_date(), Fiche\get_row_result_deprecated(), Acc_Account_Ledger\get_row_sql_deprecated(), Acc_Ledger_History_Generic\get_rowSimple(), Acc_Account_Ledger\get_solde(), Acc_Account_Ledger\get_solde_detail(), Fiche\get_solde_detail(), Acc_Ledger\get_type(), Stock\history(), html_min_page_start(), html_page_start(), isValid_deprecrated(), Acc_Ledger_Search\list_operation(), Acc_Ledger_Search\list_operation_to_reconcile(), Acc_Ledger\listing(), Acc_Bilan\load(), Acc_Ledger_Info\load(), Acc_Parm_Code\load(), Acc_Payment\load(), Anc_Balance_Simple\load(), Card_Property\load(), Dossier\load(), Noalyss_User\load(), Todo_List\load(), Acc_Ledger_Info\load_all(), Fiche_Def\load_attribute(), Document_Modele\myList(), Fiche_Def\myList(), query_to_csv(), Document_Modele\Save(), Acc_Ledger_Info\search_id_internal(), Acc_Operation\seek_internal(), Document\send(), Acc_Reconciliation\show_detail(), Html_Table\sql2table(), Profile_Menu\sub_menu(), Card_Property\update(), Document_Modele\update(), Anc_Operation\update_from_jrnx(), Customer\VatListing(), and Acc_Bilan\warning().
| DatabaseCore::prepare | ( | $p_string, | |
| $p_sql ) |
wrapper for the function pg_prepare
| $p_string | string name for pg_prepare function |
| $p_sql | is the sql to prepare |
Definition at line 935 of file database_core.class.php.
References db.
| DatabaseCore::query_to_csv | ( | $ret, | |
| $aheader ) |
with the handle of a successull query, echo each row into CSV and send it directly to output.
To save it into a file, it is needed to send first the HEADER as CSV. If there are less column than column defined in $aheader, then the columns not included in the header are not displaid
| handle | $ret | handle to a query |
| array | $aheader | double array, each item of the array contains (idx : title, type) a key type (num) and a key title |
Definition at line 1099 of file database_core.class.php.
References $csv, $e, $i, $nb, $ret, $row, count(), fetch_array(), and num_row().
Here is the call graph for this function:| DatabaseCore::rollback | ( | ) |
rollback the current transaction
Definition at line 304 of file database_core.class.php.
References $Res, and exec_sql().
Referenced by exec_sql(), execute_script(), and upload().
Here is the call graph for this function:| DatabaseCore::search_sql_inject | ( | $p_sql | ) |
FInd if a SQL Select has a SQL stmt to inject or damage Data When a SELECT SQL string is build, this string could contain a SQL attempt to damage data, so the statement DELETE TRUNCATE ... are forbidden.
Throw an exception EXC_INVALID
Definition at line 1141 of file database_core.class.php.
References _, and EXC_INVALID.
| DatabaseCore::set_db | ( | $db | ) |
| DatabaseCore::set_encoding | ( | $p_charset | ) |
Definition at line 119 of file database_core.class.php.
References db.
| DatabaseCore::set_is_open | ( | $is_open | ) |
| mixed | $is_open |
Definition at line 173 of file database_core.class.php.
References $is_open.
| DatabaseCore::set_ret | ( | $ret | ) |
| DatabaseCore::set_sql | ( | $sql | ) |
last SQL stmt executed
| string | $sql |
Definition at line 189 of file database_core.class.php.
References $sql.
| DatabaseCore::size | ( | $p_ret = null | ) |
return the number of rows found by the last query, or the number of rows from $p_ret
| $p_ret | is the result of a query, the default value is null, in that case it is related to the last query |
Definition at line 429 of file database_core.class.php.
| DatabaseCore::start | ( | ) |
: start a transaction
Definition at line 286 of file database_core.class.php.
References $Res, and exec_sql().
Referenced by lo_read(), lo_replace(), lo_write(), and upload().
Here is the call graph for this function:| DatabaseCore::status | ( | ) |
get the transaction status : The status can be
Definition at line 1030 of file database_core.class.php.
References db.
Referenced by lo_read(), lo_replace(), lo_write(), and upload().
|
static |
Definition at line 1014 of file database_core.class.php.
| DatabaseCore::upload | ( | $p_name, | |
| $only_oid = false ) |
Save one or several documents into the database , it just puts the file in the database and returns the corresponding OID , the mimetype , size ... of the document must be set in the calling function.
| name | of the variable in $_FILES |
| $only_oid | (bool) (default :true) false : return filename and oid in an array , true only OID, |
Definition at line 733 of file database_core.class.php.
References $a, $new_name, commit(), db, record_log(), rollback(), start(), and status().
Here is the call graph for this function:| DatabaseCore::verify | ( | ) |
Definition at line 114 of file database_core.class.php.
| DatabaseCore::$array |
Definition at line 44 of file database_core.class.php.
Referenced by get_array(), get_row(), and get_value().
|
protected |
database connection
Definition at line 38 of file database_core.class.php.
|
protected |
!< $dbport (int) Database port
Definition at line 47 of file database_core.class.php.
Referenced by get_dbhost().
|
protected |
Definition at line 45 of file database_core.class.php.
Referenced by get_dbname().
|
protected |
!< $dbname (string) Database name
Definition at line 46 of file database_core.class.php.
Referenced by get_dbport().
|
protected |
!< $dbhost(string) Database host
Definition at line 48 of file database_core.class.php.
Referenced by get_dbuser().
|
protected |
true is connected
Definition at line 42 of file database_core.class.php.
Referenced by get_is_open(), and set_is_open().
|
protected |
return value
Definition at line 40 of file database_core.class.php.
Referenced by exec_sql(), execute(), fetch_all(), fetch_array(), fetch_result(), fetch_row(), get_ret(), make_list(), num_row(), query_to_csv(), and set_ret().
| DatabaseCore::$sql |
last SQL stmt executed
Definition at line 43 of file database_core.class.php.
Referenced by Database\apply_patch(), clean_orphan_lob(), create_sequence(), execute_script(), get_sql(), make_list(), and set_sql().