20 private $search = null;
24 private $currentDoc = null;
29 private $hookFunction = null;
31 private $init =
false;
50 private function initSearch()
54 if (!$this->
search->isExecuted()) $this->
search->search();
55 if ($this->
search->getError()) {
58 $this->length = $this->
search->count();
66 private function getCurrentDoc()
68 $this->currentDoc = $this->
search->getNextDoc();
69 $good = ($this->callHook() !==
false);
71 while ($this->currentDoc = $this->
search->getNextDoc()) {
72 $good = ($this->callHook() !==
false);
81 $this->getCurrentDoc();
88 $this->getCurrentDoc();
91 private function callHook()
93 if ($this->currentDoc && $this->hookFunction) {
95 $h = $this->hookFunction;
96 return $h($this->currentDoc);
102 return is_array($this->currentDoc) ? $this->currentDoc[
"id"] : $this->currentDoc->id;
109 return $this->currentDoc;
116 return $this->currentDoc !=
false;
123 return $this->search;
145 $this->
search->setObjectReturn();
146 $this->
search->excludeConfidential();
147 foreach ($ids as $k => $v) {
148 if ((!$v) || (!is_numeric($v))) unset($ids[$k]);
150 $ids = array_unique($ids);
151 $sid = $useInitid ?
"initid" :
"id";
152 if (
count($ids) == 0) {
153 $this->
search->addFilter(
"false");
155 $this->
search->addFilter($this->
search->sqlCond($ids, $sid,
true));
166 $this->hookFunction = $hookFunction;
Exception class use exceptionCode to identifiy correctly exception.
addDocumentIdentifiers(array $ids, $useInitid=true)
__construct(SearchDoc &$s=null)
addDocumentIdentificators(array $ids, $useInitid=true)