Search:

# CWIS Developers Documentation

Public Member Functions | Static Public Member Functions | Public Attributes

# SavedSearch Class Reference

## Public Member Functions
| SavedSearch ($SearchId, $SearchName=NULL, $UserId=NULL, $Frequency=NULL, $SearchGroups=NULL)
| SearchGroups ($NewSearchGroups=NULL)
| SearchName ($NewValue=DB_NOVALUE)
| Get/set name of search.
| Id ()
| Get ID of search.
| UserId ($NewValue=DB_NOVALUE)
| Get/set user ID.
| Frequency ($NewValue=DB_NOVALUE)
| Get/set search frequency.
| UpdateDateLastRun ()
| DateLastRun ($NewValue=DB_NOVALUE)
| GetSearchGroupsAsUrlParameters ()
| Get search groups as URL parameters (e.g.
| GetSearchGroupsAsUrlParameterArray ()
| Get search groups as an URL parameter array.
| GetSearchGroupsAsTextDescription ($IncludeHtml=TRUE, $StartWithBreak=TRUE, $TruncateLongWordsTo=0)
| Get multi-line string describing search criteria.
| GetSearchFieldNames ()
| Get list of fields to be searched.
| Delete ()
| Delete saved search.
| GetSearchId ()
## Static Public Member Functions
static | TranslateSearchGroupsToUrlParameters ($SearchGroups)
| Translate search group array into URL parameters (e.g.
static | TranslateSearchGroupsToUrlParameterArray ($SearchGroups)
| Translate a search group array to an URL parameter array.
static | TranslateUrlParametersToSearchGroups ($GetVars)
static | TranslateSearchGroupsToTextDescription ($SearchGroups, $IncludeHtml=TRUE, $StartWithBreak=TRUE, $TruncateLongWordsTo=0)
| Translate search group array into multi-line string describing search criteria.
static | TranslateSearchGroupsToSearchFieldNames ($SearchGroups)
| Extract list of fields to be searched from search group array.
static | GetSearchFrequencyList ()
| Get array of possible search frequency descriptions.
## Public Attributes
const | SEARCHFREQ_NEVER = 0
const | SEARCHFREQ_HOURLY = 1
const | SEARCHFREQ_DAILY = 2
const | SEARCHFREQ_WEEKLY = 3
const | SEARCHFREQ_BIWEEKLY = 4
const | SEARCHFREQ_MONTHLY = 5
const | SEARCHFREQ_QUARTERLY = 6
const | SEARCHFREQ_YEARLY = 7

List of all members.

## Detailed Description

Definition at line 18 of file SavedSearch.php.

## Member Function Documentation

SavedSearch::DateLastRun | ( | $ | NewValue = `DB_NOVALUE` ) |

Definition at line 241 of file SavedSearch.php.

SavedSearch::Delete | ( | ) |

Delete saved search.

(NOTE: Object is no longer usable after this call!)

Definition at line 722 of file SavedSearch.php.

SavedSearch::Frequency | ( | $ | NewValue = `DB_NOVALUE` ) |

Get/set search frequency.

Parameters:

  NewValue | New search frequency value.

Returns:
  Current search frequency value.

Definition at line 231 of file SavedSearch.php.

Referenced by SavedSearch().

Here is the caller graph for this function:

SavedSearch::GetSearchFieldNames | ( | ) |

Get list of fields to be searched.

Returns:
  Array of field names.

Definition at line 658 of file SavedSearch.php.

References SearchGroups(), and TranslateSearchGroupsToSearchFieldNames().

static SavedSearch::GetSearchFrequencyList | ( | ) | `[static]`

Get array of possible search frequency descriptions.

Frequencies may be excluded from list by supplying them as arguments.

Returns:
  Array of search frequency descriptions indexed by SEARCHFREQ constants.

Definition at line 693 of file SavedSearch.php.

SavedSearch::GetSearchGroupsAsTextDescription | ( | $ | IncludeHtml = `TRUE`,
|  | $ | StartWithBreak = `TRUE`,
|  | $ | TruncateLongWordsTo = `0`
| ) |  |

Get multi-line string describing search criteria.

Parameters:

  IncludeHtml | Whether to include HTML tags for formatting. (OPTIONAL, defaults to TRUE)
  StartWithBreak | Whether to start string with BR tag. (OPTIONAL, defaults to TRUE)
  TruncateLongWordsTo | Number of characters to truncate long words to (use 0 for no truncation). (OPTIONAL, defaults to 0)

Returns:
  String containing text describing search criteria.

Definition at line 489 of file SavedSearch.php.

References SearchGroups(), and TranslateSearchGroupsToTextDescription().

SavedSearch::GetSearchGroupsAsUrlParameterArray | ( | ) |

Get search groups as an URL parameter array.

Returns:
  Array with strings like "F4" ("F" or "G" plus field ID) for the index and * "american+history" (search parameter) for the values.

Definition at line 338 of file SavedSearch.php.

References SearchGroups(), and TranslateSearchGroupsToUrlParameters().

SavedSearch::GetSearchGroupsAsUrlParameters | ( | ) |

Get search groups as URL parameters (e.g.

something like F2=madison&F4=american+history&G22=17-41).

Returns:
  String containing URL parameters (no leading "?").

Definition at line 249 of file SavedSearch.php.

References SearchGroups(), and TranslateSearchGroupsToUrlParameters().

SavedSearch::GetSearchId | ( | ) |

Definition at line 914 of file SavedSearch.php.

References Id().

SavedSearch::Id | ( | ) |

Get ID of search.

Returns:
  Search ID.

Definition at line 216 of file SavedSearch.php.

Referenced by GetSearchId().

Here is the caller graph for this function:

SavedSearch::SavedSearch | ( | $ | SearchId,
|  | $ | SearchName = `NULL`,
|  | $ | UserId = `NULL`,
|  | $ | Frequency = `NULL`,
|  | $ | SearchGroups = `NULL`
| ) |  |

Definition at line 33 of file SavedSearch.php.

References Frequency(), SearchGroups(), SearchName(), and UserId().

SavedSearch::SearchGroups | ( | $ | NewSearchGroups = `NULL` ) |

Definition at line 78 of file SavedSearch.php.

References SearchEngine::LOGIC_AND, and SearchEngine::LOGIC_OR.

Referenced by GetSearchFieldNames(), GetSearchGroupsAsTextDescription(), GetSearchGroupsAsUrlParameterArray(), GetSearchGroupsAsUrlParameters(), and SavedSearch().

Here is the caller graph for this function:

SavedSearch::SearchName | ( | $ | NewValue = `DB_NOVALUE` ) |

Get/set name of search.

Parameters:

  NewValue | New name of search value.

Returns:
  Current name of search value.

Definition at line 209 of file SavedSearch.php.

Referenced by SavedSearch().

Here is the caller graph for this function:

static SavedSearch::TranslateSearchGroupsToSearchFieldNames | ( | $ | SearchGroups ) | `[static]`

Extract list of fields to be searched from search group array.

Parameters:

  SearchGroups | Search group array.

Returns:
  Array of field names.

Definition at line 668 of file SavedSearch.php.

Referenced by GetSearchFieldNames().

Here is the caller graph for this function:

static SavedSearch::TranslateSearchGroupsToTextDescription | ( | $ | SearchGroups,
|  | $ | IncludeHtml = `TRUE`,
|  | $ | StartWithBreak = `TRUE`,
|  | $ | TruncateLongWordsTo = `0`
| ) |  | `[static]`

Translate search group array into multi-line string describing search criteria.

Parameters:

  SearchGroups | Search group array.
  IncludeHtml | Whether to include HTML tags for formatting. (OPTIONAL, defaults to TRUE)
  StartWithBreak | Whether to start string with BR tag. (OPTIONAL, defaults to TRUE)
  TruncateLongWordsTo | Number of characters to truncate long words to (use 0 for no truncation). (OPTIONAL, defaults to 0)

Returns:
  String containing text describing search criteria.

Definition at line 507 of file SavedSearch.php.

References MetadataSchema::MDFSTAT_OK.

Referenced by GetSearchGroupsAsTextDescription().

Here is the caller graph for this function:

static SavedSearch::TranslateSearchGroupsToUrlParameterArray | ( | $ | SearchGroups ) | `[static]`

Translate a search group array to an URL parameter array.

Parameters:

  SearchGroups | Search group array to translate.

Returns:
  Array with strings like "F4" ("F" or "G" plus field ID) for the index and * "american+history" (search parameter) for the values.

Definition at line 349 of file SavedSearch.php.

static SavedSearch::TranslateSearchGroupsToUrlParameters | ( | $ | SearchGroups ) | `[static]`

Translate search group array into URL parameters (e.g.

something like F2=madison&F4=american+history&G22=17-41).

Parameters:

  SearchGroups | Search group array.

Returns:
  String containing URL parameters (no leading "?").

Definition at line 260 of file SavedSearch.php.

Referenced by GetSearchGroupsAsUrlParameterArray(), and GetSearchGroupsAsUrlParameters().

Here is the caller graph for this function:

static SavedSearch::TranslateUrlParametersToSearchGroups | ( | $ | GetVars ) | `[static]`

Definition at line 421 of file SavedSearch.php.

References SearchEngine::LOGIC_AND, and SearchEngine::LOGIC_OR.

SavedSearch::UpdateDateLastRun | ( | ) |

Definition at line 235 of file SavedSearch.php.

SavedSearch::UserId | ( | $ | NewValue = `DB_NOVALUE` ) |

Get/set user ID.

Parameters:

  NewValue | New user ID value.

Returns:
  Current user ID value.

Definition at line 223 of file SavedSearch.php.

Referenced by SavedSearch().

Here is the caller graph for this function:

## Member Data Documentation

const SavedSearch::SEARCHFREQ_BIWEEKLY = 4

Definition at line 27 of file SavedSearch.php.

Referenced by SavedSearchFactory::GetSearchesDueToRun().

const SavedSearch::SEARCHFREQ_DAILY = 2

Definition at line 25 of file SavedSearch.php.

Referenced by SavedSearchFactory::GetSearchesDueToRun().

const SavedSearch::SEARCHFREQ_HOURLY = 1

Definition at line 24 of file SavedSearch.php.

Referenced by SavedSearchFactory::GetSearchesDueToRun().

const SavedSearch::SEARCHFREQ_MONTHLY = 5

Definition at line 28 of file SavedSearch.php.

Referenced by SavedSearchFactory::GetSearchesDueToRun().

const SavedSearch::SEARCHFREQ_NEVER = 0

Definition at line 23 of file SavedSearch.php.

const SavedSearch::SEARCHFREQ_QUARTERLY = 6

Definition at line 29 of file SavedSearch.php.

Referenced by SavedSearchFactory::GetSearchesDueToRun().

const SavedSearch::SEARCHFREQ_WEEKLY = 3

Definition at line 26 of file SavedSearch.php.

Referenced by SavedSearchFactory::GetSearchesDueToRun().

const SavedSearch::SEARCHFREQ_YEARLY = 7

Definition at line 30 of file SavedSearch.php.

Referenced by SavedSearchFactory::GetSearchesDueToRun().

The documentation for this class was generated from the following file:

- SavedSearch.php