ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Searcher.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30
32{
33 protected ClauseFactory $clause_factory;
34 protected FilterFactory $filter_factory;
36
37 public function __construct(
38 ClauseFactory $clause_factory,
39 FilterFactory $filter_factory,
41 ) {
42 $this->clause_factory = $clause_factory;
43 $this->filter_factory = $filter_factory;
44 $this->repository = $repository;
45 }
46
47 public function getClauseFactory(): ClauseFactory
48 {
50 }
51
52 public function getFilter(
53 int|Placeholder $obj_id = Placeholder::ANY,
54 int|Placeholder $sub_id = Placeholder::ANY,
55 string|Placeholder $type = Placeholder::ANY
57 if ($sub_id === 0) {
58 $sub_id = Placeholder::OBJ_ID;
59 }
60 return $this->filter_factory->get($obj_id, $sub_id, $type);
61 }
62
66 public function execute(
67 ClauseInterface $clause,
68 ?int $limit,
69 ?int $offset,
70 FilterInterface ...$filters
71 ): \Generator {
72 yield from $this->repository->searchMD(
73 $clause,
74 $limit,
75 $offset,
76 ...$filters
77 );
78 }
79}
__construct(ClauseFactory $clause_factory, FilterFactory $filter_factory, RepositoryInterface $repository)
Definition: Searcher.php:37
getFilter(int|Placeholder $obj_id=Placeholder::ANY, int|Placeholder $sub_id=Placeholder::ANY, string|Placeholder $type=Placeholder::ANY)
Get a filter with which the results of a search can be restricted.
Definition: Searcher.php:52
getClauseFactory()
Get a factory where you can assemble your search clause.
Definition: Searcher.php:47
execute(ClauseInterface $clause, ?int $limit, ?int $offset, FilterInterface ... $filters)
Definition: Searcher.php:66
if(!file_exists('../ilias.ini.php'))