ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilBookingObject 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 ilBookingObject:

Public Member Functions

 __construct (int $a_id=null)
 
 getId ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setDescription (string $a_value)
 
 getDescription ()
 
 setPoolId (int $a_pool_id)
 
 getPoolId ()
 
 setScheduleId (?int $a_schedule_id)
 
 getScheduleId ()
 
 setNrOfItems (int $a_value)
 
 getNrOfItems ()
 
 setFile (string $a_value)
 
 getFile ()
 
 getFileFullPath ()
 
 uploadFile (array $a_upload)
 Upload new info file. More...
 
 deleteFile ()
 
 setPostText (string $a_value)
 
 getPostText ()
 
 setPostFile (string $a_value)
 
 getPostFile ()
 
 getPostFileFullPath ()
 
 uploadPostFile (array $a_upload)
 Upload new post file. More...
 
 deletePostFile ()
 
 deleteFiles ()
 
 save ()
 
 update ()
 
 delete ()
 Delete single entry. More...
 
 deleteReservationsAndCalEntries (int $object_id)
 
 doClone (int $a_pool_id, array $a_schedule_map=null)
 

Static Public Member Functions

static initStorage (int $a_id, string $a_subdir="")
 Init file system storage. More...
 
static getList (int $a_pool_id, string $a_title=null)
 Get list of booking objects. More...
 
static getNumberOfObjectsForPool (int $a_pool_id)
 Get number of booking objects for given booking pool id. More...
 
static getObjectsForPool (int $a_pool_id)
 Get all booking pool object ids from an specific booking pool. More...
 
static getNrOfItemsForObjects (array $a_obj_ids)
 Get nr of available items for a set of object ids. More...
 
static lookupPoolId (int $object_id)
 
static lookupTitle (int $object_id)
 

Protected Member Functions

 read ()
 
 getDBFields ()
 

Protected Attributes

ILIAS BookingManager InternalRepoService $repo
 
ilDBInterface $db
 
int $id = 0
 
int $pool_id = 0
 
string $title = ""
 
string $description = ""
 
int $nr_of_items = 0
 
int $schedule_id = null
 
string $info_file = ""
 
string $post_text = ""
 
string $post_file = ""
 

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 A bookable ressource

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 23 of file class.ilBookingObject.php.

Constructor & Destructor Documentation

◆ __construct()

ilBookingObject::__construct ( int  $a_id = null)

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

References $DIC, ILIAS\Repository\int(), and read().

39  {
40  global $DIC;
41 
42  $this->db = $DIC->database();
43  $this->id = (int) $a_id;
44  $this->read();
45  $this->repo = $DIC->bookingManager()->internal()->repo();
46  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilBookingObject::delete ( )

Delete single entry.

Definition at line 402 of file class.ilBookingObject.php.

References $db, $ilDB, and deleteFiles().

402  : int
403  {
404  $ilDB = $this->db;
405 
406  if ($this->id) {
407  $this->deleteFiles();
408 
409  return $ilDB->manipulate('DELETE FROM booking_object' .
410  ' WHERE booking_object_id = ' . $ilDB->quote($this->id, 'integer'));
411  }
412  return 0;
413  }
+ Here is the call graph for this function:

◆ deleteFile()

ilBookingObject::deleteFile ( )

Definition at line 145 of file class.ilBookingObject.php.

References $path, getFileFullPath(), and setFile().

Referenced by uploadFile().

145  : void
146  {
147  if ($this->id) {
148  $path = $this->getFileFullPath();
149  if ($path) {
150  if (is_file($path)) {
151  unlink($path);
152  }
153  $this->setFile("");
154  }
155  }
156  }
setFile(string $a_value)
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFiles()

ilBookingObject::deleteFiles ( )

Definition at line 224 of file class.ilBookingObject.php.

References setFile(), and setPostFile().

Referenced by delete().

224  : void
225  {
226  if ($this->id) {
227  $storage = new ilFSStorageBooking($this->id);
228  $storage->delete();
229 
230  $this->setFile("");
231  $this->setPostFile("");
232  }
233  }
setFile(string $a_value)
setPostFile(string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deletePostFile()

ilBookingObject::deletePostFile ( )

Definition at line 211 of file class.ilBookingObject.php.

References $path, getPostFileFullPath(), and setPostFile().

Referenced by uploadPostFile().

211  : void
212  {
213  if ($this->id) {
214  $path = $this->getPostFileFullPath();
215  if ($path) {
216  if (is_file($path)) {
217  unlink($path);
218  }
219  $this->setPostFile("");
220  }
221  }
222  }
$path
Definition: ltiservices.php:32
setPostFile(string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteReservationsAndCalEntries()

ilBookingObject::deleteReservationsAndCalEntries ( int  $object_id)

Definition at line 415 of file class.ilBookingObject.php.

References ilCalendarEntry\delete().

415  : void
416  {
417  $reservation_db = $this->repo->reservation();
418  $reservation_ids = $reservation_db->getReservationIdsByBookingObjectId($object_id);
419 
420  foreach ($reservation_ids as $reservation_id) {
421  $reservation = new ilBookingReservation($reservation_id);
422  $entry = new ilCalendarEntry($reservation->getCalendarEntry());
423  $reservation_db->delete($reservation_id);
424  $entry->delete();
425  }
426  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ doClone()

ilBookingObject::doClone ( int  $a_pool_id,
array  $a_schedule_map = null 
)

Definition at line 452 of file class.ilBookingObject.php.

References getDescription(), getFile(), getId(), getNrOfItems(), getPostFile(), getPostText(), getScheduleId(), getTitle(), and ilFileUtils\rCopy().

455  : void {
456  $new_obj = new self();
457  $new_obj->setPoolId($a_pool_id);
458  $new_obj->setTitle($this->getTitle());
459  $new_obj->setDescription($this->getDescription());
460  $new_obj->setNrOfItems($this->getNrOfItems());
461  $new_obj->setFile($this->getFile());
462  $new_obj->setPostText($this->getPostText());
463  $new_obj->setPostFile($this->getPostFile());
464 
465  if ($a_schedule_map) {
466  $schedule_id = $this->getScheduleId();
467  if ($schedule_id) {
468  $new_obj->setScheduleId($a_schedule_map[$schedule_id] ?? null);
469  }
470  }
471 
472  $new_obj->save();
473 
474  // files
475  $source = self::initStorage($this->getId());
476  $target = $new_obj::initStorage($new_obj->getId());
477  ilFileUtils::rCopy($source, $target);
478  }
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
+ Here is the call graph for this function:

◆ getDBFields()

ilBookingObject::getDBFields ( )
protected
Returns
string[][]

Definition at line 281 of file class.ilBookingObject.php.

References getDescription(), getFile(), getNrOfItems(), getPostFile(), getPostText(), getScheduleId(), and getTitle().

Referenced by save(), and update().

281  : array
282  {
283  return array(
284  'title' => array('text', $this->getTitle()),
285  'description' => array('text', $this->getDescription()),
286  'schedule_id' => array('text', $this->getScheduleId()),
287  'nr_items' => array('text', $this->getNrOfItems()),
288  'info_file' => array('text', $this->getFile()),
289  'post_text' => array('text', $this->getPostText()),
290  'post_file' => array('text', $this->getPostFile())
291  );
292  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescription()

ilBookingObject::getDescription ( )

Definition at line 68 of file class.ilBookingObject.php.

References $description.

Referenced by doClone(), and getDBFields().

68  : string
69  {
70  return $this->description;
71  }
+ Here is the caller graph for this function:

◆ getFile()

ilBookingObject::getFile ( )

Definition at line 108 of file class.ilBookingObject.php.

References $info_file.

Referenced by doClone(), and getDBFields().

108  : string
109  {
110  return $this->info_file;
111  }
+ Here is the caller graph for this function:

◆ getFileFullPath()

ilBookingObject::getFileFullPath ( )

Definition at line 113 of file class.ilBookingObject.php.

References $info_file, and $path.

Referenced by deleteFile().

113  : string
114  {
115  if ($this->id && $this->info_file) {
116  $path = self::initStorage($this->id, "file");
117  return $path . $this->info_file;
118  }
119  return "";
120  }
$path
Definition: ltiservices.php:32
+ Here is the caller graph for this function:

◆ getId()

ilBookingObject::getId ( )

Definition at line 48 of file class.ilBookingObject.php.

References $id.

Referenced by doClone().

48  : int
49  {
50  return $this->id;
51  }
+ Here is the caller graph for this function:

◆ getList()

static ilBookingObject::getList ( int  $a_pool_id,
string  $a_title = null 
)
static

Get list of booking objects.

Definition at line 331 of file class.ilBookingObject.php.

References $DIC, $ilDB, and $res.

Referenced by ilBookingPreferencesManager\calculateBookings(), ilObjBookingPool\cloneObject(), ilBookingAssignObjectsTableGUI\getItems(), ilBookingObjectsTableGUI\getItems(), ilObjBookingPoolGUI\initEditCustomForm(), ilBookingParticipantsTableGUI\initFilter(), ilBookingReservationsTableGUI\initFilter(), ilBookingPreferencesGUI\initPreferenceForm(), ilBookingPreferencesGUI\listPreferenceOptions(), ilBookingPreferencesManager\readBookings(), ilBookingScheduleGUI\render(), and ilBookingReservationsGUI\rsvConfirmCancel().

334  : array {
335  global $DIC;
336 
337  $ilDB = $DIC->database();
338 
339  $sql = 'SELECT *' .
340  ' FROM booking_object' .
341  ' WHERE pool_id = ' . $ilDB->quote($a_pool_id, 'integer');
342 
343  if ($a_title) {
344  $sql .= ' AND (' . $ilDB->like('title', 'text', '%' . $a_title . '%') .
345  ' OR ' . $ilDB->like('description', 'text', '%' . $a_title . '%') . ')';
346  }
347 
348  $sql .= ' ORDER BY title';
349 
350  $set = $ilDB->query($sql);
351  $res = array();
352  while ($row = $ilDB->fetchAssoc($set)) {
353  $res[] = $row;
354  }
355  return $res;
356  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getNrOfItems()

ilBookingObject::getNrOfItems ( )

Definition at line 98 of file class.ilBookingObject.php.

References $nr_of_items.

Referenced by doClone(), and getDBFields().

98  : int
99  {
100  return $this->nr_of_items;
101  }
+ Here is the caller graph for this function:

◆ getNrOfItemsForObjects()

static ilBookingObject::getNrOfItemsForObjects ( array  $a_obj_ids)
static

Get nr of available items for a set of object ids.

Parameters
int[]$a_obj_ids
Returns
int[]

Definition at line 433 of file class.ilBookingObject.php.

References $DIC, $ilDB, and ILIAS\Repository\int().

Referenced by ilBookingReservation\getAvailableObject(), ilBookingReservation\getNumAvailablesNoSchedule(), and ilBookingReservation\isObjectAvailableInPeriod().

435  : array {
436  global $DIC;
437 
438  $ilDB = $DIC->database();
439 
440  $map = array();
441 
442  $set = $ilDB->query("SELECT booking_object_id,nr_items" .
443  " FROM booking_object" .
444  " WHERE " . $ilDB->in("booking_object_id", $a_obj_ids, "", "integer"));
445  while ($row = $ilDB->fetchAssoc($set)) {
446  $map[(int) $row["booking_object_id"]] = (int) $row["nr_items"];
447  }
448 
449  return $map;
450  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNumberOfObjectsForPool()

static ilBookingObject::getNumberOfObjectsForPool ( int  $a_pool_id)
static

Get number of booking objects for given booking pool id.

Definition at line 361 of file class.ilBookingObject.php.

References $DIC, and $ilDB.

Referenced by ilBookingParticipantsTableGUI\fillRow().

363  : int {
364  global $DIC;
365 
366  $ilDB = $DIC->database();
367 
368  $sql = 'SELECT count(*) as count' .
369  ' FROM booking_object' .
370  ' WHERE pool_id = ' . $ilDB->quote($a_pool_id, 'integer');
371  $set = $ilDB->query($sql);
372  $rec = $ilDB->fetchAssoc($set);
373 
374  return (int) $rec["count"];
375  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getObjectsForPool()

static ilBookingObject::getObjectsForPool ( int  $a_pool_id)
static

Get all booking pool object ids from an specific booking pool.

Definition at line 380 of file class.ilBookingObject.php.

References $DIC, $ilDB, and ILIAS\Repository\int().

382  : array {
383  global $DIC;
384  $ilDB = $DIC->database();
385 
386  $set = $ilDB->query("SELECT booking_object_id" .
387  " FROM booking_object" .
388  " WHERE pool_id = " . $ilDB->quote($a_pool_id, 'integer'));
389 
390  $objects = array();
391  while ($row = $ilDB->fetchAssoc($set)) {
392  $objects[] = (int) $row['booking_object_id'];
393  }
394 
395  return $objects;
396  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getPoolId()

ilBookingObject::getPoolId ( )

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

References $pool_id.

Referenced by save().

78  : int
79  {
80  return $this->pool_id;
81  }
+ Here is the caller graph for this function:

◆ getPostFile()

ilBookingObject::getPostFile ( )

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

References $post_file.

Referenced by doClone(), and getDBFields().

173  : string
174  {
175  return $this->post_file;
176  }
+ Here is the caller graph for this function:

◆ getPostFileFullPath()

ilBookingObject::getPostFileFullPath ( )

Definition at line 178 of file class.ilBookingObject.php.

References $path, and $post_file.

Referenced by deletePostFile().

178  : string
179  {
180  if ($this->id && $this->post_file) {
181  $path = self::initStorage($this->id, "post");
182  return $path . $this->post_file;
183  }
184  return "";
185  }
$path
Definition: ltiservices.php:32
+ Here is the caller graph for this function:

◆ getPostText()

ilBookingObject::getPostText ( )

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

References $post_text.

Referenced by doClone(), and getDBFields().

163  : string
164  {
165  return $this->post_text;
166  }
+ Here is the caller graph for this function:

◆ getScheduleId()

ilBookingObject::getScheduleId ( )

Definition at line 88 of file class.ilBookingObject.php.

References $schedule_id.

Referenced by doClone(), and getDBFields().

88  : ?int
89  {
90  return $this->schedule_id;
91  }
+ Here is the caller graph for this function:

◆ getTitle()

ilBookingObject::getTitle ( )

Definition at line 58 of file class.ilBookingObject.php.

References $title.

Referenced by doClone(), getDBFields(), and ilBookingReservationsGUI\rsvConfirmCancelAggregationForm().

58  : string
59  {
60  return $this->title;
61  }
+ Here is the caller graph for this function:

◆ initStorage()

static ilBookingObject::initStorage ( int  $a_id,
string  $a_subdir = "" 
)
static

Init file system storage.

Definition at line 238 of file class.ilBookingObject.php.

References $path.

241  : string {
242  $storage = new ilFSStorageBooking($a_id);
243  $storage->create();
244 
245  $path = $storage->getAbsolutePath() . "/";
246 
247  if ($a_subdir) {
248  $path .= $a_subdir . "/";
249 
250  if (!is_dir($path) && !mkdir($path)) {
251  throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
252  }
253  }
254 
255  return $path;
256  }
$path
Definition: ltiservices.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ lookupPoolId()

static ilBookingObject::lookupPoolId ( int  $object_id)
static

Definition at line 480 of file class.ilBookingObject.php.

References $DIC, ilDBInterface\fetchAssoc(), and ilDBInterface\queryF().

Referenced by ilBookingReservationsGUI\__construct(), ILIAS\BookingManager\BookingProcess\BookingProcessManager\bookSingle(), and ilBookingReservation\getMembersWithoutReservation().

480  : int
481  {
482  global $DIC;
483 
484  $db = $DIC->database();
485  $set = $db->queryF(
486  "SELECT pool_id FROM booking_object " .
487  " WHERE booking_object_id = %s ",
488  array("integer"),
489  array($object_id)
490  );
491  $rec = $db->fetchAssoc($set);
492  return (int) $rec["pool_id"];
493  }
fetchAssoc(ilDBStatement $statement)
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupTitle()

static ilBookingObject::lookupTitle ( int  $object_id)
static

Definition at line 495 of file class.ilBookingObject.php.

References $DIC, ilDBInterface\fetchAssoc(), and ilDBInterface\queryF().

Referenced by ilBookingPreferencesGUI\savePreferences().

495  : string
496  {
497  global $DIC;
498 
499  $db = $DIC->database();
500  $set = $db->queryF(
501  "SELECT title FROM booking_object " .
502  " WHERE booking_object_id = %s ",
503  array("integer"),
504  array($object_id)
505  );
506  $rec = $db->fetchAssoc($set);
507  return $rec["title"];
508  }
fetchAssoc(ilDBStatement $statement)
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilBookingObject::read ( )
protected

Definition at line 258 of file class.ilBookingObject.php.

References $db, $ilDB, setDescription(), setFile(), setNrOfItems(), setPoolId(), setPostFile(), setPostText(), setScheduleId(), and setTitle().

Referenced by __construct().

258  : void
259  {
260  $ilDB = $this->db;
261 
262  if ($this->id) {
263  $set = $ilDB->query('SELECT *' .
264  ' FROM booking_object' .
265  ' WHERE booking_object_id = ' . $ilDB->quote($this->id, 'integer'));
266  $row = $ilDB->fetchAssoc($set);
267  $this->setTitle((string) $row['title']);
268  $this->setDescription((string) $row['description']);
269  $this->setPoolId((int) $row['pool_id']);
270  $this->setScheduleId($row['schedule_id']);
271  $this->setNrOfItems((int) $row['nr_items']);
272  $this->setFile((string) $row['info_file']);
273  $this->setPostText((string) $row['post_text']);
274  $this->setPostFile((string) $row['post_file']);
275  }
276  }
setFile(string $a_value)
setPostText(string $a_value)
setNrOfItems(int $a_value)
setDescription(string $a_value)
setScheduleId(?int $a_schedule_id)
setPostFile(string $a_value)
setTitle(string $a_title)
setPoolId(int $a_pool_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilBookingObject::save ( )

Definition at line 294 of file class.ilBookingObject.php.

References $db, $ilDB, getDBFields(), and getPoolId().

294  : ?int
295  {
296  $ilDB = $this->db;
297 
298  if ($this->id) {
299  return null;
300  }
301 
302  $this->id = $ilDB->nextId('booking_object');
303 
304  $fields = $this->getDBFields();
305  $fields['booking_object_id'] = array('integer', $this->id);
306  $fields['pool_id'] = array('integer', $this->getPoolId());
307 
308  return $ilDB->insert('booking_object', $fields);
309  }
+ Here is the call graph for this function:

◆ setDescription()

ilBookingObject::setDescription ( string  $a_value)

Definition at line 63 of file class.ilBookingObject.php.

Referenced by read().

63  : void
64  {
65  $this->description = $a_value;
66  }
+ Here is the caller graph for this function:

◆ setFile()

ilBookingObject::setFile ( string  $a_value)

Definition at line 103 of file class.ilBookingObject.php.

Referenced by deleteFile(), deleteFiles(), read(), and uploadFile().

103  : void
104  {
105  $this->info_file = $a_value;
106  }
+ Here is the caller graph for this function:

◆ setNrOfItems()

ilBookingObject::setNrOfItems ( int  $a_value)

Definition at line 93 of file class.ilBookingObject.php.

Referenced by read().

93  : void
94  {
95  $this->nr_of_items = $a_value;
96  }
+ Here is the caller graph for this function:

◆ setPoolId()

ilBookingObject::setPoolId ( int  $a_pool_id)

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

Referenced by read().

73  : void
74  {
75  $this->pool_id = $a_pool_id;
76  }
+ Here is the caller graph for this function:

◆ setPostFile()

ilBookingObject::setPostFile ( string  $a_value)

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

Referenced by deleteFiles(), deletePostFile(), read(), and uploadPostFile().

168  : void
169  {
170  $this->post_file = $a_value;
171  }
+ Here is the caller graph for this function:

◆ setPostText()

ilBookingObject::setPostText ( string  $a_value)

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

Referenced by read().

158  : void
159  {
160  $this->post_text = $a_value;
161  }
+ Here is the caller graph for this function:

◆ setScheduleId()

ilBookingObject::setScheduleId ( ?int  $a_schedule_id)

Definition at line 83 of file class.ilBookingObject.php.

Referenced by read().

83  : void
84  {
85  $this->schedule_id = $a_schedule_id;
86  }
+ Here is the caller graph for this function:

◆ setTitle()

ilBookingObject::setTitle ( string  $a_title)

Definition at line 53 of file class.ilBookingObject.php.

Referenced by read().

53  : void
54  {
55  $this->title = $a_title;
56  }
+ Here is the caller graph for this function:

◆ update()

ilBookingObject::update ( )

Definition at line 311 of file class.ilBookingObject.php.

References $db, $ilDB, and getDBFields().

311  : ?int
312  {
313  $ilDB = $this->db;
314 
315  if (!$this->id) {
316  return null;
317  }
318 
319  $fields = $this->getDBFields();
320 
321  return $ilDB->update(
322  'booking_object',
323  $fields,
324  array('booking_object_id' => array('integer', $this->id))
325  );
326  }
+ Here is the call graph for this function:

◆ uploadFile()

ilBookingObject::uploadFile ( array  $a_upload)

Upload new info file.

Definition at line 125 of file class.ilBookingObject.php.

References $path, deleteFile(), ilFileUtils\moveUploadedFile(), and setFile().

125  : bool
126  {
127  if (!$this->id) {
128  return false;
129  }
130 
131  $this->deleteFile();
132 
133  $path = self::initStorage($this->id, "file");
134  $original = $a_upload["name"];
135  if (ilFileUtils::moveUploadedFile($a_upload["tmp_name"], $original, $path . $original)) {
136  chmod($path . $original, 0770);
137 
138  $this->setFile($original);
139  return true;
140  }
141  return false;
142  }
setFile(string $a_value)
$path
Definition: ltiservices.php:32
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
+ Here is the call graph for this function:

◆ uploadPostFile()

ilBookingObject::uploadPostFile ( array  $a_upload)

Upload new post file.

Definition at line 190 of file class.ilBookingObject.php.

References $path, deletePostFile(), ilFileUtils\moveUploadedFile(), and setPostFile().

190  : bool
191  {
192  if (!$this->id) {
193  return false;
194  }
195 
196  $this->deletePostFile();
197 
198  $path = self::initStorage($this->id, "post");
199  $original = $a_upload["name"];
200 
201  if (ilFileUtils::moveUploadedFile($a_upload["tmp_name"], $original, $path . $original)) {
202  chmod($path . $original, 0770);
203 
204  $this->setPostFile($original);
205  return true;
206  }
207  return false;
208  }
$path
Definition: ltiservices.php:32
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
setPostFile(string $a_value)
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilBookingObject::$db
protected

Definition at line 26 of file class.ilBookingObject.php.

Referenced by delete(), read(), save(), and update().

◆ $description

string ilBookingObject::$description = ""
protected

Definition at line 30 of file class.ilBookingObject.php.

Referenced by getDescription().

◆ $id

int ilBookingObject::$id = 0
protected

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

Referenced by getId().

◆ $info_file

string ilBookingObject::$info_file = ""
protected

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

Referenced by getFile(), and getFileFullPath().

◆ $nr_of_items

int ilBookingObject::$nr_of_items = 0
protected

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

Referenced by getNrOfItems().

◆ $pool_id

int ilBookingObject::$pool_id = 0
protected

Definition at line 28 of file class.ilBookingObject.php.

Referenced by getPoolId().

◆ $post_file

string ilBookingObject::$post_file = ""
protected

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

Referenced by getPostFile(), and getPostFileFullPath().

◆ $post_text

string ilBookingObject::$post_text = ""
protected

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

Referenced by getPostText().

◆ $repo

ILIAS BookingManager InternalRepoService ilBookingObject::$repo
protected

Definition at line 25 of file class.ilBookingObject.php.

◆ $schedule_id

int ilBookingObject::$schedule_id = null
protected

Definition at line 32 of file class.ilBookingObject.php.

Referenced by getScheduleId().

◆ $title

string ilBookingObject::$title = ""
protected

Definition at line 29 of file class.ilBookingObject.php.

Referenced by getTitle().


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