ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 
 hasObjectInfo (int $booking_obj_id)
 
 deliverObjectInfo (int $booking_obj_id)
 
 hasBookingInfo (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 
)

Member Function Documentation

◆ cloneTo()

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

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

190 : void {
191 if ($this->object_repo->hasObjectInfo($from_booking_obj_id) ||
192 $this->object_repo->hasBookingInfo($from_booking_obj_id)) {
193 $this->object_repo->clone($from_booking_obj_id, $to_booking_obj_id);
194 }
195 }

◆ createObjectsFromBulkInputString()

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

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

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 }

References ILIAS\BookingManager\Objects\ObjectsManager\$data, and ILIAS\BookingManager\Objects\ObjectsManager\getDataArrayFromInputString().

+ Here is the call graph for this function:

◆ deleteBookingInfo()

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

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

180 : void
181 {
182 if ($this->object_repo->hasBookingInfo($booking_obj_id)) {
183 $this->object_repo->deleteBookingInfo($booking_obj_id, $this->book_info_stakeholder);
184 }
185 }

◆ deleteObjectInfo()

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

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

173 : void
174 {
175 if ($this->object_repo->hasObjectInfo($booking_obj_id)) {
176 $this->object_repo->deleteObjectInfo($booking_obj_id, $this->object_info_stakeholder);
177 }
178 }

◆ deliverBookingInfo()

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

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

156 : void
157 {
158 if ($this->object_repo->hasBookingInfo($booking_obj_id)) {
159 $this->object_repo->deliverBookingInfo($booking_obj_id);
160 }
161 }

◆ deliverObjectInfo()

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

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

144 : void
145 {
146 if ($this->object_repo->hasObjectInfo($booking_obj_id)) {
147 $this->object_repo->deliverObjectInfo($booking_obj_id);
148 }
149 }

◆ getBookingInfoFilename()

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

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

168 : string
169 {
170 return $this->object_repo->getBookingInfoFilename($booking_obj_id);
171 }

◆ getBookingInfoPath()

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

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

202 : string
203 {
204 return $this->object_repo->getBookingInfoPath($booking_object_id);
205 }

◆ 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.

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 }

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

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

+ 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.

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 }

References Vendor\Package\$d.

◆ getObjectInfoFilename()

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

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

163 : string
164 {
165 return $this->object_repo->getObjectInfoFilename($booking_obj_id);
166 }

◆ getObjectInfoPath()

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

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

197 : string
198 {
199 return $this->object_repo->getObjectInfoPath($booking_object_id);
200 }

◆ getObjectTitles()

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

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

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 }

References Vendor\Package\$d.

◆ hasBookingInfo()

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

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

151 : bool
152 {
153 return $this->object_repo->hasBookingInfo($booking_obj_id);
154 }

◆ hasObjectInfo()

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

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

139 : bool
140 {
141 return $this->object_repo->hasObjectInfo($booking_obj_id);
142 }

◆ 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

◆ $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

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