HRDIODB
[ class tree: HRDIODB ] [ index: HRDIODB ] [ all elements ]

Class: search

Source Location: /search_class.php

Class Overview


Search class.


Methods



Class Details

[line 34]
Search class.

The search class handles all SQL related searching logic. An object of this class populates a results array with key value pairs from the database based on conditions supplied to the class instance.




[ Top ]


Class Methods


constructor search [line 41]

search search( &$hdb, hrdi_db $hdb)

Constructor.

Takes a hrdi_db class instance. Sets the internal result array to empty.




Parameters:

hrdi_db   $hdb   The hrdi_db class instance
   &$hdb  

[ Top ]

method compose_query [line 162]

string compose_query( )

Composes a SQL query.

Converts an array of conditions into a SQL query. Used by the free form search.




Tags:

return:  SQL query


[ Top ]

method filetype_filter [line 133]

mixed filetype_filter( array $filetypes)

Filters search results by file type.

Optionally called after a search has been made. It will compose and execute a query which retrieves all UARS_Day numbers which have filetypes matching the given array of filetypes. The search instances result set is then overwritten by the intersection of the previous search results and the filetype search results. This method a query for each file type and discards some fetched data, however it makes up for this by never needing to reference all UARS days in one query. That would potentially by tens of thousands of integers in one query.




Tags:

return:  An indexed array of UARS days


Parameters:

array   $filetypes   An array of integers which are filetypes stored in the database.

[ Top ]

method free_form [line 54]

mixed free_form( array $conditions)

Free form search.

Takes an array of conditions and based on those conditions stores a list of UARS_Day numbers in the results array.




Tags:

return:  An indexed array of UARS days


Parameters:

array   $conditions   An indexed array of associative arrays with four values: Table, Field, Operator, Value

[ Top ]

method pid_day_coverage [line 206]

mixed pid_day_coverage( [mixed $pid = "any"], [mixed $date_type = "none"], mixed $date_value_low, mixed $date_value_high, int $lat_day_min, int $lat_day_max, int $lat_night_min, int $lat_night_max)

Builds Pid day coverage search query.

This function takes several variables, builds a query, and returns an array of UARS days. It is a companion function to a custom search form.




Tags:

return:  An indexed array of UARS days


Parameters:

mixed   $pid   A Process_ID number or the keyword "any"
mixed   $date_type   A string which describes the format of the high and low values
mixed   $date_value_low   The low end of a date range
mixed   $date_value_high   The high end of a date range
int   $lat_day_min   The minimum acceptable day latitude
int   $lat_day_max   The maximum acceptable day latitude
int   $lat_night_min   The minimum acceptable night latitude
int   $lat_night_max   The maximum acceptable night latitude

[ Top ]


Documentation generated on Tue, 23 Jan 2007 22:57:51 -0500 by phpDocumentor 1.3.0RC6