ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilBookingInfoListItemPropertiesAdapter.php
Go to the documentation of this file.
1 <?php
2 
24 {
25  protected \ILIAS\BookingManager\Reservations\ReservationDBRepository $repo;
26 
27  public function __construct(
28  ?\ILIAS\BookingManager\Reservations\ReservationDBRepository $repo = null
29  ) {
30  $this->repo = $repo;
31  }
32 
33  public function appendProperties(
34  int $obj_id,
35  array $props
36  ): array {
37  $repo = $this->repo;
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  }
54 }
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupTitle(int $obj_id)
ILIAS BookingManager Reservations ReservationDBRepository $repo
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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,)
__construct(?\ILIAS\BookingManager\Reservations\ReservationDBRepository $repo=null)