19 declare(strict_types=1);
61 $this->assertCount(3, $ids);
62 $this->assertSame(1, $ids[0]->idx);
63 $this->assertSame(2, $ids[1]->idx);
64 $this->assertSame(3, $ids[2]->idx);
76 public array $exposed_searches = [];
78 public function __construct(
protected array $returns)
82 public function searchMD(
89 foreach ($filters as $filter) {
90 $filter_data[] = $filter->exposed_data;
92 $this->exposed_searches[] = [
93 'clause' => $clause->exposed_data,
96 'filters' => $filter_data
99 yield
from $this->returns;
106 return new class () extends NullFilterFactory {
112 $exposed = [
'obj_id' => $obj_id,
'sub_id' => $sub_id,
'type' => $type];
113 return new class ($exposed) extends
NullFilter {
114 public function __construct(
public array $exposed_data)
124 return new class () extends NullClauseFactory {
125 public function getBasicClause(
129 bool $is_mode_negated =
false 135 'is_mode_negated' => $is_mode_negated,
137 return new class ($exposed) extends
NullClause {
138 public function __construct(
public array $exposed_data)
144 public function getJoinedClauses(
150 foreach ([$first_clause, ...$further_clauses] as $clause) {
151 $clause_data[] = $clause->exposed_data;
154 'operator' => $operator,
155 'subclauses' => $clause_data
157 return new class ($exposed) extends
NullClause {
158 public function __construct(
public array $exposed_data)
172 protected array
$path = [];
174 public function withNextStep(
string $name,
bool $add_as_first =
false):
BuilderInterface 176 $clone = clone $this;
177 $clone->path[] = $name;
183 $string = implode(
'>', $this->path);
184 return new class ($string) extends
NullPath {
185 public function __construct(
protected string $string)
191 return $this->string;
203 public function buildIdentifierFromEntryID(
int $entry_id):
string 205 return 'identifier_' . $entry_id;
227 'path' =>
'rights>description>string',
228 'mode' => Mode::EQUALS,
229 'value' =>
'identifier_32',
230 'is_mode_negated' =>
false 237 $repo->exposed_searches
259 'path' =>
'rights>description>string',
260 'mode' => Mode::EQUALS,
261 'value' =>
'identifier_32',
262 'is_mode_negated' =>
false 265 'path' =>
'rights>description>string',
266 'mode' => Mode::EQUALS,
267 'value' =>
'identifier_9',
268 'is_mode_negated' =>
false 271 'path' =>
'rights>description>string',
272 'mode' => Mode::EQUALS,
273 'value' =>
'identifier_1234',
274 'is_mode_negated' =>
false 282 $repo->exposed_searches
295 $results = $searcher->withRestrictionToRepositoryObjects(
true)
304 'path' =>
'rights>description>string',
305 'mode' => Mode::EQUALS,
306 'value' =>
'identifier_32',
307 'is_mode_negated' =>
false 315 'sub_id' => Placeholder::OBJ_ID,
320 $repo->exposed_searches
333 $results = $searcher->withAdditionalTypeFilter(
'some type')
342 'path' =>
'rights>description>string',
343 'mode' => Mode::EQUALS,
344 'value' =>
'identifier_32',
345 'is_mode_negated' =>
false 354 'type' =>
'some type' 358 $repo->exposed_searches
371 $results = $searcher->withAdditionalTypeFilter(
'some type')
372 ->withAdditionalTypeFilter(
'some other type')
373 ->withAdditionalTypeFilter(
'a third type')
382 'path' =>
'rights>description>string',
383 'mode' => Mode::EQUALS,
384 'value' =>
'identifier_32',
385 'is_mode_negated' =>
false 394 'type' =>
'some type' 399 'type' =>
'some other type' 404 'type' =>
'a third type' 408 $repo->exposed_searches
421 $results = $searcher->withAdditionalTypeFilter(
'some type')
422 ->withAdditionalTypeFilter(
'some other type')
423 ->withAdditionalTypeFilter(
'a third type')
424 ->withRestrictionToRepositoryObjects(
true)
433 'path' =>
'rights>description>string',
434 'mode' => Mode::EQUALS,
435 'value' =>
'identifier_32',
436 'is_mode_negated' =>
false 444 'sub_id' => Placeholder::OBJ_ID,
445 'type' =>
'some type' 449 'sub_id' => Placeholder::OBJ_ID,
450 'type' =>
'some other type' 454 'sub_id' => Placeholder::OBJ_ID,
455 'type' =>
'a third type' 459 $repo->exposed_searches
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
Constructor setup ILIAS global object public.
custom()
expected output: > ILIAS shows a base horizontal bar chart but customized with e.g.