phpDocumentor Testlink
[ class tree: Testlink ] [ index: Testlink ] [ all elements ]

Class: database

Source Location: /database.class.php

Class database

Property Summary
mixed   $db  
mixed   $is_connected  
mixed   $nQuery  
mixed   $overallDuration  
mixed   $queries_array  

[ Top ]
Method Summary
database   database()  
void   affected_rows()  
void   build_sql_create_db()  
void   close()  
void   connect()  
void   count_queries()  
void   count_unique_queries()  
void   db_field_exists()  
void   db_is_pgsql()  
void   db_now()  
void   db_result()  
void   db_table_exists()  
void   db_timestamp()  
void   db_unixtimestamp()  
void   error()  
void   error_msg()  
void   error_num()  
void   exec_query()  
array   fetchArrayRowsIntoMap()   Fetches all rows into a map whose keys are the values of columns
array   fetchColumnsIntoArray()   Fetches all values for a given column of all returned rows
assoc   fetchColumnsIntoMap()   Fetches the values of two columns from all rows into a map
array   fetchFirstRow()   Fetches the first row (in a assoc-array)
mixed   fetchFirstRowSingleColumn()   Fetches the first column first row
void   fetchMapRowsIntoMap()  
string   fetchOneValue()   Get one value (no array) for example: SELECT COUNT(*) FROM table
array   fetchRowsIntoMap()   Fetches all rows into a map whose keys are the values of columns
void   fetch_array()  
void   getLogEnabled()  
void   getLogQueries()  
void   get_dbmgr_object()  
void   get_recordset()  
assoc   get_version_info()   database server information
void   insert_id()  
void   key_exists_on_field()  
void   microtime_float()  
void   num_rows()  
void   prepare_bool()  
void   prepare_int()  
void   prepare_string()  
void   setLogEnabled()  
void   setLogQueries()  
void   time_queries()  

[ Top ]
Properties
mixed   $db [line 54]

[ Top ]
mixed   $is_connected = false [line 56]

[ Top ]
mixed   $nQuery = 0 [line 57]

[ Top ]
mixed   $overallDuration = 0 [line 58]

[ Top ]
mixed   $queries_array = array() [line 55]

[ Top ]
Methods
Constructor database  [line 90]

  database database( $db_type  )

Parameters:
   $db_type: 


[ Top ]
affected_rows  [line 447]

  void affected_rows( )



[ Top ]
build_sql_create_db  [line 676]

  void build_sql_create_db( $db_name  )

Parameters:
   $db_name: 


[ Top ]
close  [line 412]

  void close( )



[ Top ]
connect  [line 117]

  void connect( $p_dsn, [ $p_hostname = null], [ $p_username = null], [ $p_password = null], [ $p_database_name = null]  )

Parameters:
   $p_dsn: 
   $p_hostname: 
   $p_username: 
   $p_password: 
   $p_database_name: 


[ Top ]
count_queries  [line 376]

  void count_queries( )



[ Top ]
count_unique_queries  [line 382]

  void count_unique_queries( )



[ Top ]
db_field_exists  [line 269]

  void db_field_exists( $p_field_name, $p_table_name  )

Parameters:
   $p_field_name: 
   $p_table_name: 


[ Top ]
db_is_pgsql  [line 248]

  void db_is_pgsql( )



[ Top ]
db_now  [line 333]

  void db_now( )



[ Top ]
db_result  [line 215]

  void db_result( $p_result, [ $p_index1 = 0], [ $p_index2 = 0]  )

Parameters:
   $p_result: 
   $p_index1: 
   $p_index2: 


[ Top ]
db_table_exists  [line 264]

  void db_table_exists( $p_table_name  )

Parameters:
   $p_table_name: 


[ Top ]
db_timestamp  [line 352]

  void db_timestamp( [ $p_date = null]  )

Parameters:
   $p_date: 


[ Top ]
db_unixtimestamp  [line 362]

  void db_unixtimestamp( [ $p_date = null]  )

Parameters:
   $p_date: 


[ Top ]
error  [line 431]

  void error( [ $p_query = null]  )

Parameters:
   $p_query: 


[ Top ]
error_msg  [line 423]

  void error_msg( )



[ Top ]
error_num  [line 418]

  void error_num( )



[ Top ]
exec_query  [line 141]

  void exec_query( $p_query, [ $p_limit = -1], [ $p_offset = -1]  )

Parameters:
   $p_query: 
   $p_limit: 
   $p_offset: 


[ Top ]
fetchArrayRowsIntoMap  [line 642]

  array fetchArrayRowsIntoMap( string $query, string $column, [ $limit = -1]  )

Fetches all rows into a map whose keys are the values of columns

Parameters:
string   $query:  the query to be executed
string   $column:  the name of the column
   $limit: 

API Tags:
Return:  an assoc array whose keys are the values from the columns of the rows


[ Top ]
fetchColumnsIntoArray  [line 515]

  array fetchColumnsIntoArray( string $query, string $column, [ $limit = -1]  )

Fetches all values for a given column of all returned rows

Parameters:
string   $query:  the query to be executed
string   $column:  the name of the column
   $limit: 

API Tags:
Return:  an enumerated array, which contains all the values


[ Top ]
fetchColumnsIntoMap  [line 578]

  assoc fetchColumnsIntoMap( string $query, string $column1, string $column2, [boolean $cumulative = 0], [ $limit = -1]  )

Fetches the values of two columns from all rows into a map

Parameters:
string   $query:  the query to be executed
string   $column1:  the name of the column (keys for the map)
string   $column2:  the name of the second column (values of the map)
boolean   $cumulative: 

useful in situations with results set like col1 col2 X A X B Y B

cumulative=0 -> return items= array('X' => 'B', 'Y' => 'B')

cumulative=1 -> return items= array('X' => array('A','B'), 'Y' => array('B') )

   $limit: 

API Tags:
Return:  

array whose keys are the values of column1 and the values are:

cumulative=0 => the values of column2 cumulative=1 => array with the values of column2



[ Top ]
fetchFirstRow  [line 478]

  array fetchFirstRow( string $query  )

Fetches the first row (in a assoc-array)

Parameters:
string   $query:  the query to be executed

API Tags:
Return:  the first row


[ Top ]
fetchFirstRowSingleColumn  [line 459]

  mixed fetchFirstRowSingleColumn( string $query, string $column  )

Fetches the first column first row

Parameters:
string   $query:  the query to be executed
string   $column:  the name of the column which shall be returned

API Tags:
Return:  the value of the column


[ Top ]
fetchMapRowsIntoMap  [line 657]

  void fetchMapRowsIntoMap( $query, $column_main_key, $column_sec_key, [ $limit = -1]  )

Parameters:
   $query: 
   $column_main_key: 
   $column_sec_key: 
   $limit: 


[ Top ]
fetchOneValue  [line 496]

  string fetchOneValue( string $query  )

Get one value (no array) for example: SELECT COUNT(*) FROM table

Parameters:
string   $query:  the query to be executed

API Tags:
Return:  of one value || null
Access:  public


[ Top ]
fetchRowsIntoMap  [line 538]

  array fetchRowsIntoMap( string $query, string $column, [booleam $bCumulative = 0], [ $limit = -1]  )

Fetches all rows into a map whose keys are the values of columns

Parameters:
string   $query:  the query to be executed
string   $column:  the name of the column
booleam   $bCumulative:  default 0
   $limit: 

API Tags:
Return:  an assoc array whose keys are the values from the columns of the rows


[ Top ]
fetch_array  [line 192]

  void fetch_array( &$p_result  )

Parameters:
   &$p_result: 


[ Top ]
getLogEnabled  [line 75]

  void getLogEnabled( $value  )

Parameters:
   $value: 


[ Top ]
getLogQueries  [line 84]

  void getLogQueries( $value  )

Parameters:
   $value: 


[ Top ]
get_dbmgr_object  [line 106]

  void get_dbmgr_object( )



[ Top ]
get_recordset  [line 618]

  void get_recordset( $sql, [ $fetch_mode = null], [ $limit = -1]  )

Parameters:
   $sql: 
   $fetch_mode: 
   $limit: 


[ Top ]
get_version_info  [line 610]

  assoc get_version_info( )

database server information

wrapper for adodb method ServerInfo


API Tags:
Return:  array members 'version' and 'description'


[ Top ]
insert_id  [line 235]

  void insert_id( [ $p_table = null]  )

Parameters:
   $p_table: 


[ Top ]
key_exists_on_field  [line 285]

  void key_exists_on_field( $p_table, $p_field, $p_key  )

Parameters:
   $p_table: 
   $p_field: 
   $p_key: 


[ Top ]
microtime_float  [line 66]

  void microtime_float( )



[ Top ]
num_rows  [line 442]

  void num_rows( $p_result  )

Parameters:
   $p_result: 


[ Top ]
prepare_bool  [line 327]

  void prepare_bool( $p_bool  )

Parameters:
   $p_bool: 


[ Top ]
prepare_int  [line 321]

  void prepare_int( $p_int  )

Parameters:
   $p_int: 


[ Top ]
prepare_string  [line 308]

  void prepare_string( $p_string  )

Parameters:
   $p_string: 


[ Top ]
setLogEnabled  [line 71]

  void setLogEnabled( $value  )

Parameters:
   $value: 


[ Top ]
setLogQueries  [line 80]

  void setLogQueries( $value  )

Parameters:
   $value: 


[ Top ]
time_queries  [line 397]

  void time_queries( )



[ Top ]
Constants
CUMULATIVE = 1 [line 52]

[ Top ]

Documentation generated on Fri, 03 Apr 2009 14:13:46 +0200 by phpDocumentor 1.4.1