ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
ilSearchResult ($a_user_id=0) | |
Constructor public. | |
setRequiredPermission ($a_permission) | |
Set the required permission for the rbac checks in function 'filter()'. | |
getRequiredPermission () | |
setUserId ($a_user_id) | |
getUserId () | |
getEntries () | |
isLimitReached () | |
setMaxHits ($a_max_hits) | |
getMaxHits () | |
isOffsetReached ($a_counter) | |
Check if offset is reached. | |
addEntry ($a_obj_id, $a_type, $found, $a_child_id=0) | |
add search result entry Entries are stored with 'obj_id'. | |
numEntries () | |
Check number of entries public. | |
mergeEntries (&$result_obj) | |
merge entries of this instance and another result object | |
diffEntriesFromResult (&$result_obj) | |
diff entries of this instance and another result object Used for search in results | |
intersectEntries (&$result_obj) | |
Build intersection of entries (all entries that are present in both result sets) | |
addResult ($a_ref_id, $a_obj_id, $a_type) | |
add search result Results are stored with 'ref_id'. | |
getResults () | |
getResultIds () | |
get result ids | |
getResultsByObjId () | |
getUniqueResults () | |
Get unique results. | |
getResultsForPresentation () | |
getSubitemIds () | |
filter ($a_root_node, $check_and) | |
Filter search result. | |
filterResults ($a_root_node) | |
Filter search area of result set public. | |
save ($a_type=DEFAULT_SEARCH) | |
Save search results. | |
read ($a_type=DEFAULT_SEARCH) | |
read search results | |
__updateEntryChilds ($a_obj_id, $a_childs) | |
Update childs for a specific entry. | |
__updateResultChilds ($a_ref_id, $a_childs) | |
Update childs for a specific result. | |
__initSearchSettingsObject () | |
preventOverwritingMaxhits ($a_flag=null) | |
If you call this function and pass "true" the maxhits setting will not be overwritten in __initSearchSettingsObject() | |
addObserver (&$a_class, $a_method) | |
The observer is used to call functions for filtering result. | |
callListeners ($a_ref_id, &$a_data) |
Data Fields | |
$permission = 'visible' | |
$user_id | |
$entries = array() | |
$results = array() | |
$observers = array() | |
$ilias | |
$ilAccess | |
$limit_reached = false | |
$result |
Protected Member Functions | |
initUserSearchCache () | |
Init user search cache. |
Protected Attributes | |
$search_cache = null | |
$offset = 0 | |
$preventOverwritingMaxhits = false |
Definition at line 42 of file class.ilSearchResult.php.
ilSearchResult::__initSearchSettingsObject | ( | ) |
Reimplemented in ilShopSearchResult.
Definition at line 553 of file class.ilSearchResult.php.
References preventOverwritingMaxhits(), and setMaxHits().
Referenced by ilSearchResult().
ilSearchResult::__updateEntryChilds | ( | $a_obj_id, | |
$a_childs | |||
) |
Update childs for a specific entry.
integer | object object_id |
array | array of child ids. E.g 'pg', 'st' private |
Reimplemented in ilShopSearchResult.
Definition at line 516 of file class.ilSearchResult.php.
Referenced by diffEntriesFromResult(), intersectEntries(), and mergeEntries().
ilSearchResult::__updateResultChilds | ( | $a_ref_id, | |
$a_childs | |||
) |
Update childs for a specific result.
integer | object ref_id |
array | array of child ids. E.g 'pg', 'st' private |
Definition at line 538 of file class.ilSearchResult.php.
Referenced by ilShopSearchResult\filter(), filter(), and filterResults().
ilSearchResult::addEntry | ( | $a_obj_id, | |
$a_type, | |||
$found, | |||
$a_child_id = 0 |
|||
) |
add search result entry Entries are stored with 'obj_id'.
This method is typically called to store db query results.
integer | object object_id |
string | obj_type 'lm' or 'crs' ... |
array | value position of query parser words in query string |
integer | child id e.g id of page or chapter public |
Reimplemented in ilShopSearchResult.
Definition at line 151 of file class.ilSearchResult.php.
Referenced by diffEntriesFromResult(), intersectEntries(), and mergeEntries().
ilSearchResult::addObserver | ( | & | $a_class, |
$a_method | |||
) |
The observer is used to call functions for filtering result.
Every callback function should support the following parameters: array of ids. E.g: ref_id = 5,array(obj_id = 1,type = 'crs'), The function should return true or false.
object | class of callback function |
string | name of callback method public |
Definition at line 605 of file class.ilSearchResult.php.
ilSearchResult::addResult | ( | $a_ref_id, | |
$a_obj_id, | |||
$a_type | |||
) |
add search result Results are stored with 'ref_id'.
This method is typically called after checking access of entries.
integer | ref_id |
integer | obj_id |
string | obj_type 'lm' or 'crs' ... public |
Definition at line 275 of file class.ilSearchResult.php.
Referenced by ilShopSearchResult\filter(), filter(), and filterResults().
ilSearchResult::callListeners | ( | $a_ref_id, | |
& | $a_data | ||
) |
Definition at line 611 of file class.ilSearchResult.php.
References $method.
Referenced by ilShopSearchResult\filter(), and filter().
ilSearchResult::diffEntriesFromResult | ( | & | $result_obj | ) |
diff entries of this instance and another result object Used for search in results
object | result_obj public |
Reimplemented in ilShopSearchResult.
Definition at line 220 of file class.ilSearchResult.php.
References $ref_id, __updateEntryChilds(), addEntry(), and getEntries().
ilSearchResult::filter | ( | $a_root_node, | |
$check_and | |||
) |
Filter search result.
Do RBAC checks.
Allows paging of results for referenced objects
public
int | root node id |
bool | check and boolean search |
Reimplemented in ilShopSearchResult.
Definition at line 369 of file class.ilSearchResult.php.
References $ref_id, $type, __updateResultChilds(), ilObject\_getAllReferences(), ilObject\_lookupType(), addResult(), callListeners(), getEntries(), getMaxHits(), getRequiredPermission(), and isOffsetReached().
ilSearchResult::filterResults | ( | $a_root_node | ) |
Filter search area of result set public.
Definition at line 467 of file class.ilSearchResult.php.
References $result, __updateResultChilds(), addResult(), and getResults().
ilSearchResult::getEntries | ( | ) |
Definition at line 110 of file class.ilSearchResult.php.
Referenced by diffEntriesFromResult(), ilShopSearchResult\diffEntriesFromResult(), ilShopSearchResult\filter(), filter(), intersectEntries(), and numEntries().
ilSearchResult::getMaxHits | ( | ) |
Definition at line 124 of file class.ilSearchResult.php.
Referenced by filter(), ilShopSearchResult\getResultsForPresentation(), and initUserSearchCache().
ilSearchResult::getRequiredPermission | ( | ) |
Definition at line 95 of file class.ilSearchResult.php.
References $permission.
Referenced by ilShopSearchResult\filter(), and filter().
ilSearchResult::getResultIds | ( | ) |
get result ids
public
Definition at line 293 of file class.ilSearchResult.php.
References getResults().
ilSearchResult::getResults | ( | ) |
Definition at line 282 of file class.ilSearchResult.php.
Referenced by filterResults(), getResultIds(), getResultsByObjId(), ilShopSearchResult\getResultsForPresentation(), getResultsForPresentation(), and getSubitemIds().
ilSearchResult::getResultsByObjId | ( | ) |
Definition at line 302 of file class.ilSearchResult.php.
References $ref_id, and getResults().
ilSearchResult::getResultsForPresentation | ( | ) |
Reimplemented in ilShopSearchResult.
Definition at line 334 of file class.ilSearchResult.php.
References $res, $result, and getResults().
ilSearchResult::getSubitemIds | ( | ) |
Definition at line 345 of file class.ilSearchResult.php.
References $res, $row, and getResults().
ilSearchResult::getUniqueResults | ( | ) |
Get unique results.
Return an array of obj_id (No multiple results for references) Results are stored with 'ref_id'. This method is typically called after checking access of entries. public
Reimplemented in ilShopSearchResult.
Definition at line 319 of file class.ilSearchResult.php.
References $result.
ilSearchResult::getUserId | ( | ) |
Definition at line 105 of file class.ilSearchResult.php.
References $user_id.
Referenced by initUserSearchCache().
ilSearchResult::ilSearchResult | ( | $a_user_id = 0 | ) |
Constructor public.
Definition at line 68 of file class.ilSearchResult.php.
References $ilAccess, $ilDB, $ilias, __initSearchSettingsObject(), and initUserSearchCache().
|
protected |
Init user search cache.
private
Reimplemented in ilShopSearchResult.
Definition at line 568 of file class.ilSearchResult.php.
References ilUserSearchCache\_getInstance(), getMaxHits(), and getUserId().
Referenced by ilSearchResult().
ilSearchResult::intersectEntries | ( | & | $result_obj | ) |
Build intersection of entries (all entries that are present in both result sets)
object | result_obj public |
Definition at line 245 of file class.ilSearchResult.php.
References __updateEntryChilds(), addEntry(), and getEntries().
ilSearchResult::isLimitReached | ( | ) |
Definition at line 115 of file class.ilSearchResult.php.
ilSearchResult::isOffsetReached | ( | $a_counter | ) |
Check if offset is reached.
public
int | current counter of result |
Definition at line 136 of file class.ilSearchResult.php.
Referenced by filter().
ilSearchResult::mergeEntries | ( | & | $result_obj | ) |
merge entries of this instance and another result object
object | result_obj public |
Reimplemented in ilShopSearchResult.
Definition at line 203 of file class.ilSearchResult.php.
References __updateEntryChilds(), and addEntry().
ilSearchResult::numEntries | ( | ) |
Check number of entries public.
Definition at line 192 of file class.ilSearchResult.php.
References getEntries().
ilSearchResult::preventOverwritingMaxhits | ( | $a_flag = null | ) |
If you call this function and pass "true" the maxhits setting will not be overwritten in __initSearchSettingsObject()
public
boolean | $a_flag | true or false to set the flag or leave blank to get the status of the flag boolean if called without parameter the status of the flag will be returned, otherwise $this |
Definition at line 584 of file class.ilSearchResult.php.
References $preventOverwritingMaxhits.
Referenced by __initSearchSettingsObject().
ilSearchResult::read | ( | $a_type = DEFAULT_SEARCH | ) |
read search results
integer | DEFAULT_SEARCH or ADVANCED_SEARCH public |
Definition at line 503 of file class.ilSearchResult.php.
Referenced by ilAdvancedSearchGUI\performAdvMDSearch(), ilAdvancedSearchGUI\performSearch(), ilSearchGUI\performSearch(), ilAdvancedSearchGUI\showSavedAdvMDResults(), ilSearchGUI\showSavedResults(), and ilAdvancedSearchGUI\showSavedResults().
ilSearchResult::save | ( | $a_type = DEFAULT_SEARCH | ) |
Save search results.
integer | DEFAULT_SEARCH or ADVANCED_SEARCH public |
Definition at line 492 of file class.ilSearchResult.php.
ilSearchResult::setMaxHits | ( | $a_max_hits | ) |
Definition at line 120 of file class.ilSearchResult.php.
Referenced by ilShopSearchResult\__initSearchSettingsObject(), and __initSearchSettingsObject().
ilSearchResult::setRequiredPermission | ( | $a_permission | ) |
Set the required permission for the rbac checks in function 'filter()'.
Definition at line 90 of file class.ilSearchResult.php.
ilSearchResult::setUserId | ( | $a_user_id | ) |
Definition at line 101 of file class.ilSearchResult.php.
ilSearchResult::$entries = array() |
Definition at line 47 of file class.ilSearchResult.php.
ilSearchResult::$ilAccess |
Definition at line 56 of file class.ilSearchResult.php.
Referenced by ilSearchResult().
ilSearchResult::$ilias |
Definition at line 55 of file class.ilSearchResult.php.
Referenced by ilSearchResult().
ilSearchResult::$limit_reached = false |
Definition at line 59 of file class.ilSearchResult.php.
ilSearchResult::$observers = array() |
Definition at line 49 of file class.ilSearchResult.php.
|
protected |
Definition at line 52 of file class.ilSearchResult.php.
ilSearchResult::$permission = 'visible' |
Definition at line 44 of file class.ilSearchResult.php.
Referenced by getRequiredPermission().
|
protected |
Definition at line 62 of file class.ilSearchResult.php.
Referenced by preventOverwritingMaxhits().
ilSearchResult::$result |
Definition at line 60 of file class.ilSearchResult.php.
Referenced by filterResults(), ilShopSearchResult\getResultsForPresentation(), getResultsForPresentation(), and getUniqueResults().
ilSearchResult::$results = array() |
Definition at line 48 of file class.ilSearchResult.php.
Referenced by ilShopSearchResult\getResultsForPresentation(), and ilShopSearchResult\getUniqueResults().
|
protected |
Definition at line 51 of file class.ilSearchResult.php.
ilSearchResult::$user_id |
Definition at line 46 of file class.ilSearchResult.php.
Referenced by getUserId().