ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ContSkillRetrieval.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Container\Skills;
22 
27 
29 {
30  use RetrievalBase;
31 
32  public function __construct(
33  protected ContainerSkillManager $cont_skill_manager
34  ) {
35  }
36 
37  public function getData(
38  array $fields,
39  ?Range $range = null,
40  ?Order $order = null,
41  array $filter = [],
42  array $parameters = []
43  ): \Generator {
44  $skills = $this->cont_skill_manager->getSkillsForTableGUI();
45 
46  // Apply ordering and range
47  $skills = $this->applyOrder($skills, $order);
48  $skills = $this->applyRange($skills, $range);
49 
50  foreach ($skills as $skill) {
51  $skill["id"] = $skill["base_skill_id"] . ":" . $skill["tref_id"];
52  yield $skill;
53  }
54  }
55 
56  public function count(
57  array $filter,
58  array $parameters
59  ): int {
60  $skills = $this->cont_skill_manager->getSkillsForTableGUI();
61  return count($skills);
62  }
63 
64  public function isFieldNumeric(string $field): bool
65  {
66  return in_array($field, ["base_skill_id", "tref_id"]);
67  }
68 }
count(array $filter, array $parameters)
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getData(array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
__construct(protected ContainerSkillManager $cont_skill_manager)
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28