ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 (ilBookingReservationDBRepository $repo=null)
 
 appendProperties (int $obj_id, array $props)
 

Protected Attributes

ilBookingReservationDBRepository $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 ( ilBookingReservationDBRepository  $repo = null)

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

References $repo.

29  {
30  $this->repo = $repo;
31  }

Member Function Documentation

◆ appendProperties()

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

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

References $repo, ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilBookingReservationDBRepository\getCachedContextObjBookingInfo(), and IL_CAL_DATE.

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  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _lookupTitle(int $obj_id)
const IL_CAL_DATE
getCachedContextObjBookingInfo(int $context_obj_id)
Get context object properties info.
+ Here is the call graph for this function:

Field Documentation

◆ $repo

ilBookingReservationDBRepository ilBookingInfoListItemPropertiesAdapter::$repo
protected

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