Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
restore_category_search Class Reference

A category search component. More...

Inheritance diagram for restore_category_search:
restore_search_base renderable

Public Member Functions

 __construct (array $config=array())
 Constructor. More...
 
 get_count ()
 The total number of results. More...
 
 get_results ()
 Returns an array of results from the search. More...
 
 get_search ()
 The current search string. More...
 
moodle_page get_url ()
 The URL for this search $PAGE. More...
 
 get_varsearch ()
 Returns the name to use for the search variable. More...
 
 has_more_results ()
 Returns true if there are more search results. More...
 
 invalidate_results ()
 Invalidates the results collected so far.
 
 require_capability ($capability, $user=null)
 Adds a required capability which all results will be checked against. More...
 
moodle_database search ()
 Executes the search. More...
 
 set_url (moodle_url $url)
 Sets the page URL. More...
 

Public Attributes

const DEFAULT_SEARCH = ''
 The default values for this components params.
 

Static Public Attributes

static string $VAR_SEARCH = 'catsearch'
 The search variable to use.
 

Protected Member Functions

 format_results ()
 Formats the results. More...
 
 get_itemcontextlevel ()
 Returns the context level of the search results. More...
 
moodle_database get_searchsql ()
 Returns the search SQL. More...
 

Detailed Description

A category search component.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

restore_category_search::__construct ( array  $config = array())

Constructor.

Parameters
array$config

Reimplemented from restore_search_base.

Member Function Documentation

◆ format_results()

restore_category_search::format_results ( )
protected

Formats the results.

Reimplemented from restore_search_base.

◆ get_count()

restore_search_base::get_count ( )
finalinherited

The total number of results.

Return values
int

◆ get_itemcontextlevel()

restore_category_search::get_itemcontextlevel ( )
protected

Returns the context level of the search results.

Return values
CONTEXT_COURSECAT

Reimplemented from restore_search_base.

◆ get_results()

restore_search_base::get_results ( )
finalinherited

Returns an array of results from the search.

Return values
array

◆ get_search()

restore_search_base::get_search ( )
finalinherited

The current search string.

Return values
string

◆ get_searchsql()

moodle_database restore_category_search::get_searchsql ( )
protected

Returns the search SQL.

$DB

Return values
array

Reimplemented from restore_search_base.

◆ get_url()

moodle_page restore_search_base::get_url ( )
finalinherited

The URL for this search $PAGE.

Return values
moodle_urlThe URL for this page

◆ get_varsearch()

restore_category_search::get_varsearch ( )

Returns the name to use for the search variable.

Return values
string

Reimplemented from restore_search_base.

◆ has_more_results()

restore_search_base::has_more_results ( )
finalinherited

Returns true if there are more search results.

Return values
bool

◆ require_capability()

restore_search_base::require_capability (   $capability,
  $user = null 
)
finalinherited

Adds a required capability which all results will be checked against.

Parameters
string$capability
int | null$user

◆ search()

moodle_database restore_search_base::search ( )
finalinherited

Executes the search.

$DB

Return values
intThe number of results

◆ set_url()

restore_search_base::set_url ( moodle_url  $url)
finalinherited

Sets the page URL.

Parameters
moodle_url$url

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