ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.TestParticipantInfoService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Test;
23 {
24  private \ilDBInterface $database;
25 
26  public function __construct(\ilDBInterface $db)
27  {
28  $this->database = $db;
29  }
30 
31  public function lookupTestIdByActiveId(int $active_id): int
32  {
33  $result = $this->database->queryF(
34  "SELECT test_fi FROM tst_active WHERE active_id = %s",
35  array('integer'),
36  array($active_id)
37  );
38  $test_id = -1;
39  if ($this->database->numRows($result) > 0) {
40  $row = $this->database->fetchAssoc($result);
41  $test_id = (int) $row["test_fi"];
42  }
43 
44  return $test_id;
45  }
46 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...