ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilBookingPreferences.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
13{
19 protected $preferences;
20
25 public function __construct(array $preferences)
26 {
27 $this->preferences = [];
28 foreach ($preferences as $user_id => $obj_ids) {
29 if ($user_id > 0 && is_array($obj_ids)) {
30 foreach ($obj_ids as $obj_id) {
31 if (!is_array($this->preferences[$user_id]) || !in_array($obj_id, $this->preferences[$user_id])) {
32 $this->preferences[$user_id][] = $obj_id;
33 }
34 }
35 }
36 }
37 }
38
44 public function getPreferences()
45 {
46 return $this->preferences;
47 }
48}
An exception for terminatinating execution or to throw for unit testing.
getPreferences()
Get user preferences.
__construct(array $preferences)
Constructor.