ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilBookingInfoListItemPropertiesAdapter.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
16 protected $repo;
17
23 {
24 $this->repo = $repo;
25 }
26
27
31 public function appendProperties($obj_id, $props)
32 {
34 $info = [];
35 if ($repo) {
36 foreach ($repo->getCachedContextObjBookingInfo($obj_id) as $item) {
37 $info[$item["pool_id"]]["title"] = ilObject::_lookupTitle($item["pool_id"]);
38 $info[$item["pool_id"]]["object"][$item["obj_id"]]["title"] = $item["title"];
39 $info[$item["pool_id"]]["object"][$item["obj_id"]]["bookings"][] =
40 ilDatePresentation::formatDate(new ilDate($item["date"], IL_CAL_DATE)) . ", " . $item["slot"] . " (" . $item["counter"] . ")";
41 }
42 foreach ($info as $pool) {
43 $val = "";
44 foreach ($pool["object"] as $o) {
45 $val .= $o["title"] . ": " . implode(", ", $o["bookings"]);
46 }
47 $props[] = array("alert" => false, "property" => $pool["title"], "value" => $val);
48 }
49 }
50 return $props;
51 }
52}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_DATE
appendProperties($obj_id, $props)
Get booking info properties.
__construct(ilBookingReservationDBRepository $repo=null)
Constructor.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
Class for single dates.
static _lookupTitle($a_id)
lookup object title