Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_search\document_factory Class Reference

Search document factory. More...

Static Public Member Functions

static clean_static ()
 Clears static vars.
 
static instance ($itemid, $componentname, $areaname, $engine=false)
 Returns the appropiate document object as it depends on the engine.
 

Static Protected Attributes

static array $docclassnames = array()
 The document class used by search engines.
 

Detailed Description

Search document factory.

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

Member Function Documentation

◆ clean_static()

static core_search\document_factory::clean_static ( )
static

Clears static vars.

Return values
void

◆ instance()

static core_search\document_factory::instance ( $itemid,
$componentname,
$areaname,
$engine = false )
static

Returns the appropiate document object as it depends on the engine.

Parameters
int$itemidDocument itemid
string$componentnameDocument component name
string$areanameDocument area name
core_search\engine$engineFalls back to the search engine in use.
Return values
core_search\documentBase document or the engine implementation.

Member Data Documentation

◆ $docclassnames

array core_search\document_factory::$docclassnames = array()
staticprotected

The document class used by search engines.

Defined as an array to prevent unexpected caching issues, it should only contain one search engine as only one search engine will be used during a request. This might change during testing, remember to use document_factory\clean_statics in that case.


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