Phpfox_Search

Description

Search Class is used to perform searches on all sections on the site.

  • author: Raymond Benc
  • version: $Id: search.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/search/search.class.php (line 17)


	
			
Variable Summary
 array $_aConds
 array $_aHtml
 array $_aParams
 array $_aSearch
 bool $_bCache
 object $_oReq
 object $_oUrl
 string $_sType
Method Summary
 Phpfox_Search __construct ()
 mixed cacheResults (string $sSearch, array $aIds, [array $aExtraParams = null])
 void clear ()
 mixed get (string $sName)
 array getConditions ()
 array getCustom ()
 string getDisplay ()
 int getPage ()
 mixed getSearch (int $iId, int $iPage, int $iPageSize)
 int getSearchTotal (int $iDef)
 string getSort ()
 string highlight (string $sSearch, string $sStr)
 bool isSearch ()
 bool isSearching ()
 object Return live ()
 void search (string $sType, mixed $mFields, string $sSearch)
 object Return set (array $aParams)
 void setCondition (string $sValue)
 object Return setRequests ()
 void setSort (string $sSort)
 string shorten (string $sSearch, string $sStr, int $iStart, int $iEnd)
 string _getParam (string $sVar)
 void _getQueries ()
 string _getVar (string $sName)
 void _prepare ()
 void _reset ()
Variables
array $_aConditions = array() (line 31)

SQL conditions.

  • access: private
array $_aConds = array() (line 54)

SQL conditions.

  • access: private
array $_aHtml = array() (line 24)

Holds HTML form.

  • access: private
array $_aParams = array() (line 110)

Search settings.

  • access: private
array $_aSearch = array() (line 89)

Search results.

  • access: private
bool $_bCache = false (line 96)

Define if we should cache the search results.

  • access: private
bool $_bIsSearch = false (line 75)

Check if a search has been performed.

  • access: private
bool $_bLiveQuery = false (line 117)

Perform a live search with no caching or storage.

  • access: private
int $_iSearchPage = 0 (line 61)

Current page the search is on.

  • access: private
int $_iSearchTotal = 0 (line 68)

Total search results.

  • access: private
object $_oReq = null (line 39)

Request object.

object $_oUrl = null (line 47)

URL object.

string $_sSearchResults (line 103)

Search results as a string.

  • access: private
string $_sType (line 82)

Type of search we are performing.

  • access: private
Methods
Constructor __construct (line 123)

Class constructor that loads request and url objects.

  • access: public
Phpfox_Search __construct ()
cacheResults (line 390)

Cache a search into the database.

  • return: If the 2nd argument is empty we return FALSE, otherwise we return NULL.
  • access: public
mixed cacheResults (string $sSearch, array $aIds, [array $aExtraParams = null])
  • string $sSearch: Search value.
  • array $aIds: ARRAY of value IDs.
  • array $aExtraParams: Extra params you want to store in the database.
clear (line 359)

Clear the current search form.

  • access: public
void clear ()
get (line 517)

Get a specific search value.

  • return: If search value is found it will return the value, otherwise NULL.
  • access: public
mixed get (string $sName)
  • string $sName: Search name.
getConditions (line 321)

Get all SQL conditions.

  • access: public
array getConditions ()
getCustom (line 590)

Get custom search results.

  • access: public
array getCustom ()
getDisplay (line 301)

Get the display.

  • access: public
string getDisplay ()
getPage (line 527)

Get the current page we are on.

  • access: public
int getPage ()
getSearch (line 452)

Get the search we cached in the database.

  • return: If the search is invalid it returns FALSE, otherwise NULL.
  • access: public
mixed getSearch (int $iId, int $iPage, int $iPageSize)
  • int $iId: Search ID#.
  • int $iPage: Current page we are on.
  • int $iPageSize: How many rows to display per page.
getSearchTotal (line 538)

Get the search total.

  • access: public
int getSearchTotal (int $iDef)
  • int $iDef: Default search total.
getSort (line 271)

Get the current sorting order.

  • access: public
string getSort ()
highlight (line 550)

Highlight a search string.

  • return: Text with highlighted search string is returned.
  • access: public
string highlight (string $sSearch, string $sStr)
  • string $sSearch: Search value.
  • string $sStr: String to find and highlight the search value.
isSearch (line 227)

Check if we submitted the search form.

  • return: TRUE if form submitted, FALSE if not.
  • access: public
bool isSearch ()
isSearching (line 217)

Check to see if we are currently trying to perform a search.

  • return: TRUE we are searching, FALSE if we are not.
  • access: public
bool isSearching ()
live (line 190)

Define that this is a live search.

  • return: self object.
  • access: public
object Return live ()
search (line 372)

Build a search ARRAY based on the SQL driver.

  • access: public
void search (string $sType, mixed $mFields, string $sSearch)
  • string $sType: Type of search we are performing.
  • mixed $mFields: SQL fields to check.
  • string $sSearch: Search value.
set (line 135)

Build the search form.

  • return: self object.
  • access: public
object Return set (array $aParams)
  • array $aParams: Search fields and settings.
setCondition (line 311)

Set an SQL condition.

  • access: public
void setCondition (string $sValue)
  • string $sValue
setRequests (line 202)

Force to set search requests.

  • return: self object.
  • access: public
object Return setRequests ()
setSort (line 261)

Set the sorting order of the search.

  • access: public
void setSort (string $sSort)
  • string $sSort
shorten (line 568)

Shorten a search result.

  • return: Shortened search result.
  • access: public
string shorten (string $sSearch, string $sStr, int $iStart, int $iEnd)
  • string $sSearch: Search value.
  • string $sStr: Search string.
  • int $iStart: Define when to look into the search.
  • int $iEnd: Define when to end the search.
_getParam (line 617)

Get a search param.

  • return: Param value.
  • access: private
string _getParam (string $sVar)
  • string $sVar: Param name.
_getQueries (line 637)

Process the search routine.

  • access: private
void _getQueries ()
_getVar (line 732)

Get a search value.

  • return: Search value.
  • access: private
string _getVar (string $sName)
  • string $sName: Search name.
_prepare (line 741)

Prepare and build the search form.

  • access: private
void _prepare ()
_reset (line 626)

Reset a search.

  • access: private
void _reset ()

Documentation generated on Tue, 28 Sep 2010 10:36:43 +0200 by phpDocumentor 1.4.0a2