ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCourseObjectiveResultCache.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=0);
26 {
27  private static array $suggested = [];
28  private static array $status = [];
29 
30  public static function isSuggested(int $a_usr_id, int $a_crs_id, int $a_objective_id): bool
31  {
32  if (!isset(self::$suggested[$a_usr_id][$a_crs_id])) {
33  self::$suggested[$a_usr_id][$a_crs_id] = self::readSuggested($a_usr_id, $a_crs_id);
34  }
35  return in_array($a_objective_id, self::$suggested[$a_usr_id][$a_crs_id]);
36  }
37 
38  public static function getStatus(int $a_usr_id, int $a_crs_id): string
39  {
40  if (isset(self::$status[$a_usr_id][$a_crs_id])) {
41  return self::$status[$a_usr_id][$a_crs_id];
42  }
43  $tmp_res = new ilCourseObjectiveResult($a_usr_id);
44  return self::$status[$a_usr_id][$a_crs_id] = $tmp_res->getStatus($a_crs_id);
45  }
46 
47  protected static function readSuggested(int $a_usr_id, int $a_crs_id): array
48  {
49  return ilCourseObjectiveResult::_getSuggested($a_usr_id, $a_crs_id, self::getStatus($a_usr_id, $a_crs_id));
50  }
51 }
static isSuggested(int $a_usr_id, int $a_crs_id, int $a_objective_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static readSuggested(int $a_usr_id, int $a_crs_id)
static _getSuggested(int $a_user_id, int $a_crs_id, string $a_status=self::IL_OBJECTIVE_STATUS_FINAL)
static getStatus(int $a_usr_id, int $a_crs_id)