ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Factory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
27 class Factory implements FactoryInterface
28 {
29  public function getBasicClause(
31  Mode $mode,
32  string $value,
33  bool $is_mode_negated = false
34  ): ClauseInterface {
35  if (count(iterator_to_array($path->steps())) === 0) {
36  throw new \ilMDRepositoryException('Paths in search clauses must not be empty.');
37  }
38 
39  return new Clause(
40  false,
41  false,
42  null,
43  new BasicProperties(
44  $path,
45  $mode,
46  $value,
47  $is_mode_negated
48  )
49  );
50  }
51 
52  public function getJoinedClauses(
53  Operator $operator,
54  ClauseInterface $first_clause,
55  ClauseInterface ...$further_clauses
56  ): ClauseInterface {
57  if (count($further_clauses) === 0) {
58  return $first_clause;
59  }
60  return new Clause(
61  false,
62  true,
63  new JoinProperties(
64  $operator,
65  $first_clause,
66  ...$further_clauses
67  ),
68  null
69  );
70  }
71 
73  {
74  return new Clause(
75  !$clause->isNegated(),
76  $clause->isJoin(),
77  $clause->joinProperties(),
78  $clause->basicProperties()
79  );
80  }
81 }
steps()
Get all steps in the path.
getNegatedClause(ClauseInterface $clause)
Negating a clause does not negate the condition on values, e.g.
Definition: Factory.php:72
$path
Definition: ltiservices.php:29
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getJoinedClauses(Operator $operator, ClauseInterface $first_clause, ClauseInterface ... $further_clauses)
Joins multiple clauses with an operator, leading to search clauses like: "Find all LOM sets that have...
Definition: Factory.php:52
getBasicClause(PathInterface $path, Mode $mode, string $value, bool $is_mode_negated=false)
Basic search clause with the following semantics: "Find all LOM sets that have at least one element a...
Definition: Factory.php:29