36 public function getEntries(
int $from = null,
int $to = null,
int $user_id = null, array $classes = null)
39 $lng = $this->service->language();
44 $from = (is_null($from))
45 ? time() - (365 * 24 * 60 * 60)
49 foreach ($this->service->provider()->getAllProviders(
true, $user_id) as $provider) {
50 if (is_array($classes) && !in_array(get_class($provider), $classes)) {
54 foreach ($provider->getEntries($from, $to) as
$e) {
55 $sort_array[] = array(
"entry" =>
$e,
"ts" =>
$e->getTimestamp());
64 if (date(
"Y-m-d", $to) == date(
"Y-m-d", time())) {
65 if (count($sort_array) == 0 ||
66 date(
"Y-m-d", (current($sort_array)[
"ts"])) != date(
"Y-m-d", time())) {
67 $entries[] = $this->service->factory()->entry(
68 $lng->txt(
"lhist_no_entries"),
69 $lng->txt(
"lhist_no_entries"),
78 foreach ($sort_array as $s) {
79 $entries[] = $s[
"entry"];
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getEntries(int $from=null, int $to=null, int $user_id=null, array $classes=null)
Get entries.
Learning history service.
Learning history entry collector.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct(ilLearningHistoryService $service)
Constructor.