ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilBookingInfoListItemPropertiesAdapter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilBookingInfoListItemPropertiesAdapter:

Public Member Functions

 __construct (?\ILIAS\BookingManager\Reservations\ReservationDBRepository $repo=null)
 
 appendProperties (int $obj_id, array $props)
 

Protected Attributes

ILIAS BookingManager Reservations ReservationDBRepository $repo
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Get list item properties for booking info

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilBookingInfoListItemPropertiesAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

ilBookingInfoListItemPropertiesAdapter::__construct ( ?\ILIAS\BookingManager\Reservations\ReservationDBRepository  $repo = null)

Definition at line 27 of file class.ilBookingInfoListItemPropertiesAdapter.php.

29 {
30 $this->repo = $repo;
31 }
ILIAS BookingManager Reservations ReservationDBRepository $repo

References $repo.

Member Function Documentation

◆ appendProperties()

ilBookingInfoListItemPropertiesAdapter::appendProperties ( int  $obj_id,
array  $props 
)

Definition at line 33 of file class.ilBookingInfoListItemPropertiesAdapter.php.

36 : array {
38 $info = [];
39 foreach ($repo->getCachedContextObjBookingInfo($obj_id) as $item) {
40 $info[$item["pool_id"]]["title"] = ilObject::_lookupTitle($item["pool_id"]);
41 $info[$item["pool_id"]]["object"][$item["object_id"]]["title"] = $item["title"];
42 $info[$item["pool_id"]]["object"][$item["object_id"]]["bookings"][] =
43 ilDatePresentation::formatDate(new ilDate($item["date"], IL_CAL_DATE)) . ", " . $item["slot"] . " (" . $item["counter"] . ")";
44 }
45 foreach ($info as $pool) {
46 $val = "";
47 foreach ($pool["object"] as $o) {
48 $val .= $o["title"] . ": " . implode(", ", $o["bookings"]);
49 }
50 $props[] = array("alert" => false, "property" => $pool["title"], "value" => $val);
51 }
52 return $props;
53 }
const IL_CAL_DATE
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
Class for single dates.
static _lookupTitle(int $obj_id)
$info
Definition: entry_point.php:21

References $info, ilObject\_lookupTitle(), ilDatePresentation\formatDate(), and IL_CAL_DATE.

+ Here is the call graph for this function:

Field Documentation

◆ $repo

ILIAS BookingManager Reservations ReservationDBRepository ilBookingInfoListItemPropertiesAdapter::$repo
protected

Definition at line 25 of file class.ilBookingInfoListItemPropertiesAdapter.php.

Referenced by __construct().


The documentation for this class was generated from the following file: