Class Db

Description

Located in /classes/Db.php (line 6)


	
			
Method Summary
Db __construct ()
void display_error (string $query)
array find_links (int $id, string $tbl, bool $master, [bool $opt = false])
string find_service_links (int $id)
void get_command_opts ([ $type = 1])
void get_tbl_opts ( $type)
void insert_query ( $query)
mixed query (string $query, [bool $return = true])
void search_query ( $tbl,  $field,  $keyword)
void success ([ $msg = ''])
void __deconstruct ()
Methods
Constructor __construct (line 17)

establishes DB connection upon initialization

Db __construct ()
display_error (line 35)

displays formatted error message

void display_error (string $query)
  • string $query: the query that was attempted
find_links (line 175)

checks for table relationships, both master to slave, and slave to master

  • return: assoc array of SQL results | empty array
array find_links (int $id, string $tbl, bool $master, [bool $opt = false])
  • int $id: object id, primary key
  • string $tbl: lnkObjectToObject DB table to check
  • bool $opt: used for special calls to get hosts/services/contacts with "use as template" fields
  • bool $master: = boolean, master to slave, or slave to master?
find_service_links (line 198)

link finder for servicegroup to service relationships

  • return: a string in the following format (hostid::hostgroupID::serviceid)
string find_service_links (int $id)
  • int $id: the object ID to find relationships for
get_command_opts (line 159)
void get_command_opts ([ $type = 1])
  • $type
get_hostservice_opts (line 219)
void get_hostservice_opts ()
get_tbl_opts (line 137)
void get_tbl_opts ( $type)
  • $type
insert_query (line 114)
void insert_query ( $query)
  • $query
query (line 74)

executes an SQL query, returns results as an associative array OR returns NULL

  • return: null | associative array with SQL results
mixed query (string $query, [bool $return = true])
  • string $query: the SQL query to be run
  • bool $return: do we want the data back?
search_query (line 97)
void search_query ( $tbl,  $field,  $keyword)
  • $tbl
  • $field
  • $keyword
success (line 45)

this function is not used in production

  • deprecated: no longer used
void success ([ $msg = ''])
  • $msg
__deconstruct (line 25)

close DB connection upon de-initialization

void __deconstruct ()

Documentation generated on Thu, 04 Aug 2011 14:15:15 -0500 by phpDocumentor 1.4.3