ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilDerivedTaskCollector.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
16 protected $service;
17
23 {
24 $this->service = $service;
25 }
26
33 public function getEntries(int $user_id)
34 {
35 $sort_array = [];
37 foreach ($this->service->derived()->factory()->getAllProviders(true, $user_id) as $provider) {
38 foreach ($provider->getTasks($user_id) as $t) {
39 $sort_array[] = array("entry" => $t,"ts" => $t->getDeadline());
40 }
41 }
42
43 $sort_array = ilUtil::sortArray($sort_array, "ts", "desc");
44
45 // add today entry
46 $entries = [];
47
48 foreach ($sort_array as $s) {
49 $entries[] = $s["entry"];
50 }
51
52 return $entries;
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
__construct(ilTaskService $service)
Constructor.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray