ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDerivedTaskCollector.php
Go to the documentation of this file.
1<?php
2
25{
27
32 {
33 $this->service = $service;
34 }
35
42 public function getEntries(int $user_id): array
43 {
44 $sort_array = [];
46 foreach ($this->service->derived()->factory()->getAllProviders(true, $user_id) as $provider) {
47 foreach ($provider->getTasks($user_id) as $t) {
48 $sort_array[] = array("entry" => $t,"ts" => $t->getDeadline());
49 }
50 }
51
52 $sort_array = ilArrayUtil::sortArray($sort_array, "ts", "desc");
53
54 // add today entry
55 $entries = [];
56
57 foreach ($sort_array as $s) {
58 $entries[] = $s["entry"];
59 }
60
61 return $entries;
62 }
63}
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilTaskService $service)
Constructor.
$provider
Definition: ltitoken.php:80