57 $this->user_id = $a_user_id;
60 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
63 $this->offset = $this->
settings->getMaxHits() * ($this->cache->getResultPageNumber() - 1);
74 if(self::$instance ==
null)
88 $this->filters[] = $filter;
98 $this->result = $a_ids;
107 return $this->result ? $this->result : array();
143 return $this->checked ? $this->checked : array();
152 foreach($this->checked as $obj_id)
154 $obj_ids[] = $obj_id;
156 return $obj_ids ? $obj_ids : array();
165 return $this->checked ? $this->checked : array();
174 return $this->
settings->getMaxHits();
183 $this->checked = $this->cache->getResults();
199 global $ilAccess,$tree;
213 $this->cache->appendToFailed(
$ref_id);
218 if($this->cache->isFailed(
$ref_id))
223 if($this->cache->isChecked(
$ref_id) and !$this->isOffsetReached($offset_counter))
231 if($ilAccess->checkAccessOfUser($this->getUserId(),
232 $this->getRequiredPermission(),
240 $this->
append($ref_id,$obj_id);
241 $this->cache->appendToChecked(
$ref_id,$obj_id);
246 $this->cache->appendToFailed(
$ref_id);
251 $this->limit_reached =
true;
253 $this->cache->save();
258 $this->cache->save();
269 foreach($this->filters as $filter)
271 if(!$filter->filter($a_ref_id))
284 protected function append($a_ref_id,$a_obj_id)
286 $this->checked[$a_ref_id] = $a_obj_id;
296 return $a_current_nr < $this->offset ? false :
true;
An exception for terminatinating execution or to throw for unit testing.
static getLogger($a_component_id)
Get component logger.
Validate Lucene search results Do access checks, create ref_ids from obj_ids...
filter()
Filter search results.
loadFromDb()
Load results from db.
getResultIds()
get filtered ids
getCandidates()
get result ids
addFilter(ilLuceneResultFilter $filter)
add filter
static getInstance($a_user_id)
__construct($a_user_id)
Singleton constructor.
checkFilter($a_ref_id)
check appended filter
append($a_ref_id, $a_obj_id)
Append to filtered results.
getRequiredPermission()
Get required permission.
setCandidates($a_ids)
Set result ids.
isOffsetReached($a_current_nr)
Check if offset is reached.
isLimitReached()
Check if search max hits is reached.
getResultObjIds()
get filtered ids
static _getAllReferences($a_id)
get all reference ids of object
static _getInstance($a_usr_id)
Get singleton instance.