ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\MetaData\Services\Search\Searcher Class Reference
+ Inheritance diagram for ILIAS\MetaData\Services\Search\Searcher:
+ Collaboration diagram for ILIAS\MetaData\Services\Search\Searcher:

Public Member Functions

 __construct (ClauseFactory $clause_factory, FilterFactory $filter_factory, RepositoryInterface $repository)
 
 getClauseFactory ()
 Get a factory where you can assemble your search clause. More...
 
 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. More...
 
 execute (ClauseInterface $clause, ?int $limit, ?int $offset, FilterInterface ... $filters)
 

Protected Attributes

ClauseFactory $clause_factory
 
FilterFactory $filter_factory
 
RepositoryInterface $repository
 

Detailed Description

Definition at line 31 of file Searcher.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Services\Search\Searcher::__construct ( ClauseFactory  $clause_factory,
FilterFactory  $filter_factory,
RepositoryInterface  $repository 
)

Definition at line 37 of file Searcher.php.

References ILIAS\MetaData\Services\Search\Searcher\$clause_factory, ILIAS\MetaData\Services\Search\Searcher\$filter_factory, ILIAS\MetaData\Services\Search\Searcher\$repository, and ILIAS\UI\examples\Deck\repository().

41  {
42  $this->clause_factory = $clause_factory;
43  $this->filter_factory = $filter_factory;
44  $this->repository = $repository;
45  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

Member Function Documentation

◆ execute()

ILIAS\MetaData\Services\Search\Searcher::execute ( ClauseInterface  $clause,
?int  $limit,
?int  $offset,
FilterInterface ...  $filters 
)
Returns
RessourceIDInterface[]

Implements ILIAS\MetaData\Services\Search\SearcherInterface.

Definition at line 66 of file Searcher.php.

References ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), and ILIAS\UI\examples\Deck\repository().

71  : \Generator {
72  yield from $this->repository->searchMD(
73  $clause,
74  $limit,
75  $offset,
76  ...$filters
77  );
78  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ getClauseFactory()

ILIAS\MetaData\Services\Search\Searcher::getClauseFactory ( )

Get a factory where you can assemble your search clause.

Implements ILIAS\MetaData\Services\Search\SearcherInterface.

Definition at line 47 of file Searcher.php.

References ILIAS\MetaData\Services\Search\Searcher\$clause_factory.

◆ getFilter()

ILIAS\MetaData\Services\Search\Searcher::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.

You can either give specific values for the three identifying parameters of objects (see {

See also
::read()} for a description of what those are), or placeholders to accept either any value or to force two parameters to match.

Implements ILIAS\MetaData\Services\Search\SearcherInterface.

Definition at line 52 of file Searcher.php.

56  : FilterInterface {
57  if ($sub_id === 0) {
58  $sub_id = Placeholder::OBJ_ID;
59  }
60  return $this->filter_factory->get($obj_id, $sub_id, $type);
61  }

Field Documentation

◆ $clause_factory

ClauseFactory ILIAS\MetaData\Services\Search\Searcher::$clause_factory
protected

◆ $filter_factory

FilterFactory ILIAS\MetaData\Services\Search\Searcher::$filter_factory
protected

Definition at line 34 of file Searcher.php.

Referenced by ILIAS\MetaData\Services\Search\Searcher\__construct().

◆ $repository

RepositoryInterface ILIAS\MetaData\Services\Search\Searcher::$repository
protected

Definition at line 35 of file Searcher.php.

Referenced by ILIAS\MetaData\Services\Search\Searcher\__construct().


The documentation for this class was generated from the following file: