ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\BookingManager\Objects\ObjectsManager Class Reference
+ Collaboration diagram for ILIAS\BookingManager\Objects\ObjectsManager:

Public Member Functions

 __construct (InternalDataService $data, InternalRepoService $repo, InternalDomainService $domain, protected ResourceStakeholder $object_info_stakeholder, protected ResourceStakeholder $book_info_stakeholder, int $pool_id)
 
 getNrOfItemsForObject (int $book_obj_id)
 
 getObjectTitles ()
 
 getObjectIds ()
 
 getColorNrForObject (int $book_obj_id)
 
 getDataArrayFromInputString (string $input)
 
 createObjectsFromBulkInputString (string $input, int $schedule_id)
 
 importObjectInfoFromLegacyUpload (int $booking_obj_id, array $file_input)
 
 importBookingInfoFromLegacyUpload (int $booking_obj_id, array $file_input)
 
 deliverObjectInfo (int $booking_obj_id)
 
 deliverBookingInfo (int $booking_obj_id)
 
 getObjectInfoFilename (int $booking_obj_id)
 
 getBookingInfoFilename (int $booking_obj_id)
 
 deleteObjectInfo (int $booking_obj_id)
 
 deleteBookingInfo (int $booking_obj_id)
 
 cloneTo (int $from_booking_obj_id, int $to_booking_obj_id)
 
 getObjectInfoPath (int $booking_object_id)
 
 getBookingInfoPath (int $booking_object_id)
 

Protected Attributes

int $pool_id
 
ObjectsDBRepository $object_repo
 
InternalRepoService $repo
 
InternalDataService $data
 
InternalDomainService $domain
 

Detailed Description

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

Definition at line 31 of file class.ObjectsManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\BookingManager\Objects\ObjectsManager::__construct ( InternalDataService  $data,
InternalRepoService  $repo,
InternalDomainService  $domain,
protected ResourceStakeholder  $object_info_stakeholder,
protected ResourceStakeholder  $book_info_stakeholder,
int  $pool_id 
)

Definition at line 39 of file class.ObjectsManager.php.

References ILIAS\BookingManager\Objects\ObjectsManager\$pool_id, and ILIAS\BookingManager\InternalRepoService\objects().

46  {
47  $this->object_repo = $repo->objects();
48  $this->object_repo->loadDataOfPool($pool_id);
49  $this->pool_id = $pool_id;
50  }
+ Here is the call graph for this function:

Member Function Documentation

◆ cloneTo()

ILIAS\BookingManager\Objects\ObjectsManager::cloneTo ( int  $from_booking_obj_id,
int  $to_booking_obj_id 
)

Definition at line 177 of file class.ObjectsManager.php.

180  : void {
181  if ($this->object_repo->hasObjectInfo($from_booking_obj_id) ||
182  $this->object_repo->hasBookingInfo($from_booking_obj_id)) {
183  $this->object_repo->clone($from_booking_obj_id, $to_booking_obj_id);
184  }
185  }

◆ createObjectsFromBulkInputString()

ILIAS\BookingManager\Objects\ObjectsManager::createObjectsFromBulkInputString ( string  $input,
int  $schedule_id 
)

Definition at line 96 of file class.ObjectsManager.php.

References ILIAS\BookingManager\Objects\ObjectsManager\getDataArrayFromInputString().

96  : void
97  {
98  foreach ($this->getDataArrayFromInputString($input) as $data) {
99  $object = new \ilBookingObject();
100  $object->setTitle($data["title"]);
101  $object->setDescription($data["description"]);
102  $object->setNrOfItems((int) $data["nr"]);
103  $object->setPoolId($this->pool_id);
104  if ($schedule_id > 0) {
105  $object->setScheduleId($schedule_id);
106  }
107  $object->save();
108  }
109  }
+ Here is the call graph for this function:

◆ deleteBookingInfo()

ILIAS\BookingManager\Objects\ObjectsManager::deleteBookingInfo ( int  $booking_obj_id)

Definition at line 170 of file class.ObjectsManager.php.

170  : string
171  {
172  if ($this->object_repo->hasBookingInfo($booking_obj_id)) {
173  $this->object_repo->deleteBookingInfo($booking_obj_id);
174  }
175  }

◆ deleteObjectInfo()

ILIAS\BookingManager\Objects\ObjectsManager::deleteObjectInfo ( int  $booking_obj_id)

Definition at line 163 of file class.ObjectsManager.php.

163  : void
164  {
165  if ($this->object_repo->hasObjectInfo($booking_obj_id)) {
166  $this->object_repo->deleteObjectInfo($booking_obj_id);
167  }
168  }

◆ deliverBookingInfo()

ILIAS\BookingManager\Objects\ObjectsManager::deliverBookingInfo ( int  $booking_obj_id)

Definition at line 146 of file class.ObjectsManager.php.

146  : void
147  {
148  if ($this->object_repo->hasBookingInfo($booking_obj_id)) {
149  $this->object_repo->deliverBookingInfo($booking_obj_id);
150  }
151  }

◆ deliverObjectInfo()

ILIAS\BookingManager\Objects\ObjectsManager::deliverObjectInfo ( int  $booking_obj_id)

Definition at line 139 of file class.ObjectsManager.php.

139  : void
140  {
141  if ($this->object_repo->hasObjectInfo($booking_obj_id)) {
142  $this->object_repo->deliverObjectInfo($booking_obj_id);
143  }
144  }

◆ getBookingInfoFilename()

ILIAS\BookingManager\Objects\ObjectsManager::getBookingInfoFilename ( int  $booking_obj_id)

Definition at line 158 of file class.ObjectsManager.php.

158  : string
159  {
160  return $this->object_repo->getBookingInfoFilename($booking_obj_id);
161  }

◆ getBookingInfoPath()

ILIAS\BookingManager\Objects\ObjectsManager::getBookingInfoPath ( int  $booking_object_id)

Definition at line 192 of file class.ObjectsManager.php.

192  : int
193  {
194  return $this->object_repo->getBookingInfoPath($booking_object_id);
195  }

◆ getColorNrForObject()

ILIAS\BookingManager\Objects\ObjectsManager::getColorNrForObject ( int  $book_obj_id)

Definition at line 73 of file class.ObjectsManager.php.

73  : int
74  {
75  return $this->object_repo->getColorNrForObject($book_obj_id);
76  }

◆ getDataArrayFromInputString()

ILIAS\BookingManager\Objects\ObjectsManager::getDataArrayFromInputString ( string  $input)

Definition at line 78 of file class.ObjectsManager.php.

References ILIAS\BookingManager\Objects\ObjectsManager\$data.

Referenced by ILIAS\BookingManager\Objects\ObjectsManager\createObjectsFromBulkInputString().

78  : array
79  {
80  $rows = explode("\n", $input);
81  $data = [];
82  foreach ($rows as $row) {
83  $cells = explode(";", $row);
84  if (count($cells) === 1) {
85  $cells = explode("\t", $row);
86  }
87  $data[] = [
88  "title" => trim($cells[0] ?? ""),
89  "description" => trim($cells[1] ?? ""),
90  "nr" => trim($cells[2] ?? ""),
91  ];
92  }
93  return $data;
94  }
+ Here is the caller graph for this function:

◆ getNrOfItemsForObject()

ILIAS\BookingManager\Objects\ObjectsManager::getNrOfItemsForObject ( int  $book_obj_id)

Definition at line 52 of file class.ObjectsManager.php.

52  : int
53  {
54  return $this->object_repo->getNrOfItemsForObject($book_obj_id);
55  }

◆ getObjectIds()

ILIAS\BookingManager\Objects\ObjectsManager::getObjectIds ( )

Definition at line 66 of file class.ObjectsManager.php.

References Vendor\Package\$d.

66  : array
67  {
68  return array_map(static function ($d) {
69  return (int) $d["booking_object_id"];
70  }, $this->object_repo->getObjectDataForPool($this->pool_id));
71  }

◆ getObjectInfoFilename()

ILIAS\BookingManager\Objects\ObjectsManager::getObjectInfoFilename ( int  $booking_obj_id)

Definition at line 153 of file class.ObjectsManager.php.

153  : string
154  {
155  return $this->object_repo->getObjectInfoFilename($booking_obj_id);
156  }

◆ getObjectInfoPath()

ILIAS\BookingManager\Objects\ObjectsManager::getObjectInfoPath ( int  $booking_object_id)

Definition at line 187 of file class.ObjectsManager.php.

187  : int
188  {
189  return $this->object_repo->getObjectInfoPath($booking_object_id);
190  }

◆ getObjectTitles()

ILIAS\BookingManager\Objects\ObjectsManager::getObjectTitles ( )

Definition at line 57 of file class.ObjectsManager.php.

References Vendor\Package\$d.

57  : array
58  {
59  $titles = [];
60  foreach ($this->object_repo->getObjectDataForPool($this->pool_id) as $d) {
61  $titles[$d["booking_object_id"]] = $d["title"];
62  }
63  return $titles;
64  }

◆ importBookingInfoFromLegacyUpload()

ILIAS\BookingManager\Objects\ObjectsManager::importBookingInfoFromLegacyUpload ( int  $booking_obj_id,
array  $file_input 
)

Definition at line 127 of file class.ObjectsManager.php.

127  : string
128  {
129  if (!isset($file_input["tmp_name"])) {
130  return "";
131  }
132  return $this->object_repo->importBookingInfoFromLegacyUpload(
133  $booking_obj_id,
134  $file_input,
135  $this->book_info_stakeholder
136  );
137  }

◆ importObjectInfoFromLegacyUpload()

ILIAS\BookingManager\Objects\ObjectsManager::importObjectInfoFromLegacyUpload ( int  $booking_obj_id,
array  $file_input 
)

Definition at line 115 of file class.ObjectsManager.php.

115  : string
116  {
117  if (!isset($file_input["tmp_name"])) {
118  return "";
119  }
120  return $this->object_repo->importObjectInfoFromLegacyUpload(
121  $booking_obj_id,
122  $file_input,
123  $this->object_info_stakeholder
124  );
125  }

Field Documentation

◆ $data

InternalDataService ILIAS\BookingManager\Objects\ObjectsManager::$data
protected

◆ $domain

InternalDomainService ILIAS\BookingManager\Objects\ObjectsManager::$domain
protected

Definition at line 37 of file class.ObjectsManager.php.

◆ $object_repo

ObjectsDBRepository ILIAS\BookingManager\Objects\ObjectsManager::$object_repo
protected

Definition at line 34 of file class.ObjectsManager.php.

◆ $pool_id

int ILIAS\BookingManager\Objects\ObjectsManager::$pool_id
protected

◆ $repo

InternalRepoService ILIAS\BookingManager\Objects\ObjectsManager::$repo
protected

Definition at line 35 of file class.ObjectsManager.php.


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