19 declare(strict_types=1);
51 $this->listener = $a_callback;
69 if ($this->position < count($this->objects)) {
76 @call_user_func($this->listener);
79 if ($this->position < count($this->objects)) {
118 public function addObject(
int $a_value,
float $a_relevance = 0): void
120 $this->objects[] = $a_value;
121 $this->relevance[$a_value] = $a_relevance;
129 return isset($this->relevance[$a_obj_id]) ? $this->relevance[$a_obj_id] / $this->
getMaxScore() * 100 : 0;
135 $this->limit = $a_limit;
146 $this->max_score = $a_score;
156 $this->total_hits = $a_hits;
setCallback(array $a_callback)
set search callback
current()
Iterator current.
static getLogger(string $a_component_id)
Get component logger.
addObject(int $a_value, float $a_relevance=0)
getRelevance(int $a_obj_id)
Search result implementing iterator interface.
setMaxScore(float $a_score)
setTotalHits(int $a_hits)