Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
import_course_search Class Reference

Extends the restore course search to search for import courses. More...

Inheritance diagram for import_course_search:
restore_course_search restore_search_base renderable

Public Member Functions

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

Public Attributes

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

Static Public Attributes

static string $VAR_SEARCH = 'search'
 

Protected Member Functions

 format_results ()
 Formats results.
 
 get_itemcontextlevel ()
 Gets the context level for the search result items.
 
moodle_database get_searchsql ()
 Get the search SQL.
 
 setup_restrictions ()
 Sets up any access restrictions for the courses to be displayed in the search.
 

Protected Attributes

int $currentcourseid = null
 The current course id.
 
bool $includecurrentcourse
 Determines if the current course is included in the results.
 

Detailed Description

Extends the restore course search to search for import courses.

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

Member Function Documentation

◆ format_results()

restore_course_search::format_results ( )
protectedinherited

Formats results.

Reimplemented from restore_search_base.

◆ get_count()

restore_search_base::get_count ( )
finalinherited

The total number of results.

Return values
int

◆ get_current_course_id()

restore_course_search::get_current_course_id ( )
inherited

Get the current course id.

Return values
int

◆ get_itemcontextlevel()

restore_course_search::get_itemcontextlevel ( )
protectedinherited

Gets the context level for the search result items.

Return values
CONTEXT_|int

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_course_search::get_searchsql ( )
protectedinherited

Get 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_course_search::get_varsearch ( )
inherited

Returns the name the search variable should use.

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

◆ setup_restrictions()

import_course_search::setup_restrictions ( )
protected

Sets up any access restrictions for the courses to be displayed in the search.

This will typically call $this->require_capability().

Reimplemented from restore_course_search.


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