ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBookingObject Class Reference

a bookable ressource More...

+ Collaboration diagram for ilBookingObject:

Public Member Functions

 __construct ($a_id=null)
 Constructor. More...
 
 getId ()
 Get id. More...
 
 setTitle ($a_title)
 Set object title. More...
 
 getTitle ()
 Get object title. More...
 
 setDescription ($a_value)
 Set object description. More...
 
 getDescription ()
 Get object description. More...
 
 setPoolId ($a_pool_id)
 Set booking pool id. More...
 
 getPoolId ()
 Get booking pool id. More...
 
 setScheduleId ($a_schedule_id)
 Set booking schedule id. More...
 
 getScheduleId ()
 Get booking schedule id. More...
 
 setNrOfItems ($a_value)
 Set number of items. More...
 
 getNrOfItems ()
 Get number of items. More...
 
 setFile ($a_value)
 Set info file. More...
 
 getFile ()
 Get info file. More...
 
 getFileFullPath ()
 Get path to info file. More...
 
 uploadFile (array $a_upload)
 Upload new info file. More...
 
 deleteFile ()
 remove existing info file More...
 
 setPostText ($a_value)
 Set post text. More...
 
 getPostText ()
 Get post text. More...
 
 setPostFile ($a_value)
 Set post file. More...
 
 getPostFile ()
 Get post file. More...
 
 getPostFileFullPath ()
 Get path to post file. More...
 
 uploadPostFile (array $a_upload)
 Upload new post file. More...
 
 deletePostFile ()
 remove existing post file More...
 
 deleteFiles ()
 remove existing files More...
 
 save ()
 Create new entry in db. More...
 
 update ()
 Update entry in db. More...
 
 delete ()
 Delete single entry. More...
 
 doClone ($a_pool_id, $a_schedule_map=null)
 

Static Public Member Functions

static initStorage ($a_id, $a_subdir=null)
 Init file system storage. More...
 
static getList ($a_pool_id, $a_title=null)
 Get list of booking objects for given type. More...
 
static getNumberOfObjectsForPool ($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. More...
 
static lookupPoolId ($object_id)
 Lookup pool id. More...
 

Protected Member Functions

 read ()
 Get dataset from db. More...
 
 getDBFields ()
 Parse properties for sql statements. More...
 

Protected Attributes

 $db
 
 $id
 
 $pool_id
 
 $title
 
 $description
 
 $nr_of_items
 
 $schedule_id
 
 $info_file
 
 $post_text
 
 $post_file
 

Detailed Description

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
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilBookingObject::__construct (   $a_id = null)

Constructor.

if id is given will read dataset from db

Parameters
int$a_id

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

References $DIC, and read().

37  {
38  global $DIC;
39 
40  $this->db = $DIC->database();
41  $this->id = (int) $a_id;
42  $this->read();
43  }
global $DIC
Definition: saml.php:7
read()
Get dataset from db.
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilBookingObject::delete ( )

Delete single entry.

Returns
bool

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

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

503  {
504  $ilDB = $this->db;
505 
506  if ($this->id) {
507  $this->deleteFiles();
508 
509  return $ilDB->manipulate('DELETE FROM booking_object' .
510  ' WHERE booking_object_id = ' . $ilDB->quote($this->id, 'integer'));
511  }
512  }
global $ilDB
deleteFiles()
remove existing files
+ Here is the call graph for this function:

◆ deleteFile()

ilBookingObject::deleteFile ( )

remove existing info file

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

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

Referenced by uploadFile().

202  {
203  if ($this->id) {
204  $path = $this->getFileFullPath();
205  if ($path) {
206  @unlink($path);
207  $this->setFile(null);
208  }
209  }
210  }
$path
Definition: aliased.php:25
getFileFullPath()
Get path to info file.
setFile($a_value)
Set info file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFiles()

ilBookingObject::deleteFiles ( )

remove existing files

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

References setFile(), and setPostFile().

Referenced by delete().

303  {
304  if ($this->id) {
305  include_once "Modules/BookingManager/classes/class.ilFSStorageBooking.php";
306  $storage = new ilFSStorageBooking($this->id);
307  $storage->delete();
308 
309  $this->setFile(null);
310  $this->setPostFile(null);
311  }
312  }
setFile($a_value)
Set info file.
setPostFile($a_value)
Set post file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deletePostFile()

ilBookingObject::deletePostFile ( )

remove existing post file

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

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

Referenced by uploadPostFile().

289  {
290  if ($this->id) {
291  $path = $this->getPostFileFullPath();
292  if ($path) {
293  @unlink($path);
294  $this->setPostFile(null);
295  }
296  }
297  }
getPostFileFullPath()
Get path to post file.
$path
Definition: aliased.php:25
setPostFile($a_value)
Set post file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doClone()

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

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

References $schedule_id, $source, $target, getDescription(), getFile(), getId(), getNrOfItems(), getPostFile(), getPostText(), getScheduleId(), getTitle(), initStorage(), and ilUtil\rCopy().

538  {
539  $new_obj = new self();
540  $new_obj->setPoolId($a_pool_id);
541  $new_obj->setTitle($this->getTitle());
542  $new_obj->setDescription($this->getDescription());
543  $new_obj->setNrOfItems($this->getNrOfItems());
544  $new_obj->setFile($this->getFile());
545  $new_obj->setPostText($this->getPostText());
546  $new_obj->setPostFile($this->getPostFile());
547 
548  if ($a_schedule_map) {
549  $schedule_id = $this->getScheduleId();
550  if ($schedule_id) {
551  $new_obj->setScheduleId($a_schedule_map[$schedule_id]);
552  }
553  }
554 
555  $new_obj->save();
556 
557  // files
558  $source = $this->initStorage($this->getId());
559  $target = $new_obj->initStorage($new_obj->getId());
561  }
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
getPostFile()
Get post file.
getFile()
Get info file.
getTitle()
Get object title.
getScheduleId()
Get booking schedule id.
static initStorage($a_id, $a_subdir=null)
Init file system storage.
getNrOfItems()
Get number of items.
getPostText()
Get post text.
$source
Definition: linkback.php:22
getDescription()
Get object description.
$target
Definition: test.php:19
+ Here is the call graph for this function:

◆ getDBFields()

ilBookingObject::getDBFields ( )
protected

Parse properties for sql statements.

Returns
array

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

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

Referenced by save(), and update().

368  {
369  $fields = array(
370  'title' => array('text', $this->getTitle()),
371  'description' => array('text', $this->getDescription()),
372  'schedule_id' => array('text', $this->getScheduleId()),
373  'nr_items' => array('text', $this->getNrOfItems()),
374  'info_file' => array('text', $this->getFile()),
375  'post_text' => array('text', $this->getPostText()),
376  'post_file' => array('text', $this->getPostFile())
377  );
378 
379  return $fields;
380  }
getPostFile()
Get post file.
getFile()
Get info file.
getTitle()
Get object title.
getScheduleId()
Get booking schedule id.
getNrOfItems()
Get number of items.
getPostText()
Get post text.
getDescription()
Get object description.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescription()

ilBookingObject::getDescription ( )

Get object description.

Returns
string

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

References $description.

Referenced by doClone(), and getDBFields().

86  {
87  return $this->description;
88  }
+ Here is the caller graph for this function:

◆ getFile()

ilBookingObject::getFile ( )

Get info file.

Returns
string

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

References $info_file.

Referenced by doClone(), and getDBFields().

158  {
159  return $this->info_file;
160  }
+ Here is the caller graph for this function:

◆ getFileFullPath()

ilBookingObject::getFileFullPath ( )

Get path to info file.

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

References $info_file, $path, and initStorage().

Referenced by deleteFile().

166  {
167  if ($this->id && $this->info_file) {
168  $path = $this->initStorage($this->id, "file");
169  return $path . $this->info_file;
170  }
171  }
$path
Definition: aliased.php:25
static initStorage($a_id, $a_subdir=null)
Init file system storage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilBookingObject::getId ( )

Get id.

Returns
int

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

References $id.

Referenced by doClone().

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

◆ getList()

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

Get list of booking objects for given type.

Parameters
int$a_pool_id
string$a_title
Returns
array

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

References $DIC, $ilDB, $res, and $row.

Referenced by ilObjBookingPool\cloneObject(), ilBookingAssignObjectsTableGUI\getItems(), ilBookingObjectsTableGUI\getItems(), ilObjBookingPoolGUI\initEditCustomForm(), ilBookingParticipantsTableGUI\initFilter(), ilBookingReservationsTableGUI\initFilter(), ilBookingScheduleGUI\render(), and ilObjBookingPoolGUI\rsvConfirmCancelObject().

431  {
432  global $DIC;
433 
434  $ilDB = $DIC->database();
435 
436  $sql = 'SELECT *' .
437  ' FROM booking_object' .
438  ' WHERE pool_id = ' . $ilDB->quote($a_pool_id, 'integer');
439 
440  if ($a_title) {
441  $sql .= ' AND (' . $ilDB->like('title', 'text', '%' . $a_title . '%') .
442  ' OR ' . $ilDB->like('description', 'text', '%' . $a_title . '%') . ')';
443  }
444 
445  $sql .= ' ORDER BY title';
446 
447  $set = $ilDB->query($sql);
448  $res = array();
449  while ($row = $ilDB->fetchAssoc($set)) {
450  $res[] = $row;
451  }
452  return $res;
453  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getNrOfItems()

ilBookingObject::getNrOfItems ( )

Get number of items.

Returns
int

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

References $nr_of_items.

Referenced by doClone(), and getDBFields().

140  {
141  return $this->nr_of_items;
142  }
+ Here is the caller graph for this function:

◆ getNrOfItemsForObjects()

static ilBookingObject::getNrOfItemsForObjects ( array  $a_obj_ids)
static

Get nr of available items.

Parameters
array$a_obj_ids
Returns
array

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

References $DIC, $ilDB, $map, and $row.

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

520  {
521  global $DIC;
522 
523  $ilDB = $DIC->database();
524 
525  $map = array();
526 
527  $set = $ilDB->query("SELECT booking_object_id,nr_items" .
528  " FROM booking_object" .
529  " WHERE " . $ilDB->in("booking_object_id", $a_obj_ids, "", "integer"));
530  while ($row = $ilDB->fetchAssoc($set)) {
531  $map[$row["booking_object_id"]] = $row["nr_items"];
532  }
533 
534  return $map;
535  }
global $DIC
Definition: saml.php:7
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getNumberOfObjectsForPool()

static ilBookingObject::getNumberOfObjectsForPool (   $a_pool_id)
static

Get number of booking objects for given booking pool id.

Parameters
int$a_pool_id
Returns
int

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

References $DIC, and $ilDB.

461  {
462  global $DIC;
463 
464  $ilDB = $DIC->database();
465 
466  $sql = 'SELECT count(*) as count' .
467  ' FROM booking_object' .
468  ' WHERE pool_id = ' . $ilDB->quote($a_pool_id, 'integer');
469  $set = $ilDB->query($sql);
470  $rec = $ilDB->fetchAssoc($set);
471 
472  return $rec["count"];
473  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ getObjectsForPool()

static ilBookingObject::getObjectsForPool ( int  $a_pool_id)
static

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

Parameters
int$a_pool_id
Returns
array

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

References $DIC, $ilDB, and $row.

Referenced by ilBookingReservation\isBookingPoolLimitReachedByUser().

480  : array
481  {
482  global $DIC;
483  $ilDB = $DIC->database();
484 
485  $set = $ilDB->query("SELECT booking_object_id" .
486  " FROM booking_object" .
487  " WHERE pool_id = " . $ilDB->quote($a_pool_id, 'integer'));
488 
489  $objects = array();
490  while ($row = $ilDB->fetchAssoc($set)) {
491  $objects[] = $row['booking_object_id'];
492  }
493 
494  return $objects;
495  }
global $DIC
Definition: saml.php:7
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getPoolId()

ilBookingObject::getPoolId ( )

Get booking pool id.

Returns
int

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

References $pool_id.

Referenced by save().

104  {
105  return $this->pool_id;
106  }
+ Here is the caller graph for this function:

◆ getPostFile()

ilBookingObject::getPostFile ( )

Get post file.

Returns
string

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

References $post_file.

Referenced by doClone(), and getDBFields().

244  {
245  return $this->post_file;
246  }
+ Here is the caller graph for this function:

◆ getPostFileFullPath()

ilBookingObject::getPostFileFullPath ( )

Get path to post file.

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

References $path, $post_file, and initStorage().

Referenced by deletePostFile().

252  {
253  if ($this->id && $this->post_file) {
254  $path = $this->initStorage($this->id, "post");
255  return $path . $this->post_file;
256  }
257  }
$path
Definition: aliased.php:25
static initStorage($a_id, $a_subdir=null)
Init file system storage.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPostText()

ilBookingObject::getPostText ( )

Get post text.

Returns
string

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

References $post_text.

Referenced by doClone(), and getDBFields().

226  {
227  return $this->post_text;
228  }
+ Here is the caller graph for this function:

◆ getScheduleId()

ilBookingObject::getScheduleId ( )

Get booking schedule id.

Returns
int

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

References $schedule_id.

Referenced by doClone(), and getDBFields().

122  {
123  return $this->schedule_id;
124  }
+ Here is the caller graph for this function:

◆ getTitle()

ilBookingObject::getTitle ( )

Get object title.

Returns
string

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

References $title.

Referenced by doClone(), getDBFields(), ilObjBookingPoolGUI\rsvConfirmCancelAggregationForm(), ilObjBookingPoolGUI\rsvConfirmCancelObject(), and ilObjBookingPoolGUI\rsvConfirmDeleteObject().

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

◆ initStorage()

static ilBookingObject::initStorage (   $a_id,
  $a_subdir = null 
)
static

Init file system storage.

Parameters
type$a_id
type$a_subdir
Returns
string

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

References $path.

Referenced by doClone(), getFileFullPath(), getPostFileFullPath(), uploadFile(), and uploadPostFile().

322  {
323  include_once "Modules/BookingManager/classes/class.ilFSStorageBooking.php";
324  $storage = new ilFSStorageBooking($a_id);
325  $storage->create();
326 
327  $path = $storage->getAbsolutePath() . "/";
328 
329  if ($a_subdir) {
330  $path .= $a_subdir . "/";
331 
332  if (!is_dir($path)) {
333  mkdir($path);
334  }
335  }
336 
337  return $path;
338  }
$path
Definition: aliased.php:25
+ Here is the caller graph for this function:

◆ lookupPoolId()

static ilBookingObject::lookupPoolId (   $object_id)
static

Lookup pool id.

Parameters
int$object_id
Returns
int

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

References $db, and $DIC.

Referenced by ilObjBookingPoolGUI\__construct(), and ilBookingReservation\getMembersWithoutReservation().

570  {
571  global $DIC;
572 
573  $db = $DIC->database();
574  $set = $db->queryF(
575  "SELECT pool_id FROM booking_object " .
576  " WHERE booking_object_id = %s ",
577  array("integer"),
578  array($object_id)
579  );
580  $rec = $db->fetchAssoc($set);
581  return (int) $rec["pool_id"];
582  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ read()

ilBookingObject::read ( )
protected

Get dataset from db.

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

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

Referenced by __construct().

344  {
345  $ilDB = $this->db;
346 
347  if ($this->id) {
348  $set = $ilDB->query('SELECT *' .
349  ' FROM booking_object' .
350  ' WHERE booking_object_id = ' . $ilDB->quote($this->id, 'integer'));
351  $row = $ilDB->fetchAssoc($set);
352  $this->setTitle($row['title']);
353  $this->setDescription($row['description']);
354  $this->setPoolId($row['pool_id']);
355  $this->setScheduleId($row['schedule_id']);
356  $this->setNrOfItems($row['nr_items']);
357  $this->setFile($row['info_file']);
358  $this->setPostText($row['post_text']);
359  $this->setPostFile($row['post_file']);
360  }
361  }
setPostText($a_value)
Set post text.
setScheduleId($a_schedule_id)
Set booking schedule id.
setFile($a_value)
Set info file.
setDescription($a_value)
Set object description.
setTitle($a_title)
Set object title.
setNrOfItems($a_value)
Set number of items.
$row
global $ilDB
setPostFile($a_value)
Set post file.
setPoolId($a_pool_id)
Set booking pool id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilBookingObject::save ( )

Create new entry in db.

Returns
bool

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

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

387  {
388  $ilDB = $this->db;
389 
390  if ($this->id) {
391  return false;
392  }
393 
394  $this->id = $ilDB->nextId('booking_object');
395 
396  $fields = $this->getDBFields();
397  $fields['booking_object_id'] = array('integer', $this->id);
398  $fields['pool_id'] = array('integer', $this->getPoolId());
399 
400  return $ilDB->insert('booking_object', $fields);
401  }
getDBFields()
Parse properties for sql statements.
getPoolId()
Get booking pool id.
global $ilDB
+ Here is the call graph for this function:

◆ setDescription()

ilBookingObject::setDescription (   $a_value)

Set object description.

Parameters
string$a_value

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

Referenced by read().

77  {
78  $this->description = $a_value;
79  }
+ Here is the caller graph for this function:

◆ setFile()

ilBookingObject::setFile (   $a_value)

Set info file.

Parameters
string$a_value

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

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

149  {
150  $this->info_file = $a_value;
151  }
+ Here is the caller graph for this function:

◆ setNrOfItems()

ilBookingObject::setNrOfItems (   $a_value)

Set number of items.

Parameters
int$a_value

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

Referenced by read().

131  {
132  $this->nr_of_items = (int) $a_value;
133  }
+ Here is the caller graph for this function:

◆ setPoolId()

ilBookingObject::setPoolId (   $a_pool_id)

Set booking pool id.

Parameters
int$a_pool_id

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

Referenced by read(), and ilBookingObjectGUI\save().

95  {
96  $this->pool_id = (int) $a_pool_id;
97  }
+ Here is the caller graph for this function:

◆ setPostFile()

ilBookingObject::setPostFile (   $a_value)

Set post file.

Parameters
string$a_value

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

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

235  {
236  $this->post_file = $a_value;
237  }
+ Here is the caller graph for this function:

◆ setPostText()

ilBookingObject::setPostText (   $a_value)

Set post text.

Parameters
string$a_value

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

Referenced by read().

217  {
218  $this->post_text = $a_value;
219  }
+ Here is the caller graph for this function:

◆ setScheduleId()

ilBookingObject::setScheduleId (   $a_schedule_id)

Set booking schedule id.

Parameters
int$a_schedule_id

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

Referenced by read().

113  {
114  $this->schedule_id = (int) $a_schedule_id;
115  }
+ Here is the caller graph for this function:

◆ setTitle()

ilBookingObject::setTitle (   $a_title)

Set object title.

Parameters
string$a_title

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

Referenced by read().

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

◆ update()

ilBookingObject::update ( )

Update entry in db.

Returns
bool

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

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

408  {
409  $ilDB = $this->db;
410 
411  if (!$this->id) {
412  return false;
413  }
414 
415  $fields = $this->getDBFields();
416 
417  return $ilDB->update(
418  'booking_object',
419  $fields,
420  array('booking_object_id' => array('integer', $this->id))
421  );
422  }
getDBFields()
Parse properties for sql statements.
global $ilDB
+ Here is the call graph for this function:

◆ uploadFile()

ilBookingObject::uploadFile ( array  $a_upload)

Upload new info file.

Parameters
array$a_upload
Returns
bool

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

References $path, deleteFile(), initStorage(), and setFile().

180  {
181  if (!$this->id) {
182  return false;
183  }
184 
185  $this->deleteFile();
186 
187  $path = $this->initStorage($this->id, "file");
188  $original = $a_upload["name"];
189  if (ilUtil::moveUploadedFile($a_upload["tmp_name"], $original, $path . $original)) {
190  chmod($path . $original, 0770);
191 
192  $this->setFile($original);
193  return true;
194  }
195  return false;
196  }
deleteFile()
remove existing info file
$path
Definition: aliased.php:25
setFile($a_value)
Set info file.
static initStorage($a_id, $a_subdir=null)
Init file system storage.
+ Here is the call graph for this function:

◆ uploadPostFile()

ilBookingObject::uploadPostFile ( array  $a_upload)

Upload new post file.

Parameters
array$a_upload
Returns
bool

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

References $path, deletePostFile(), initStorage(), and setPostFile().

266  {
267  if (!$this->id) {
268  return false;
269  }
270 
271  $this->deletePostFile();
272 
273  $path = $this->initStorage($this->id, "post");
274  $original = $a_upload["name"];
275 
276  if (ilUtil::moveUploadedFile($a_upload["tmp_name"], $original, $path . $original)) {
277  chmod($path . $original, 0770);
278 
279  $this->setPostFile($original);
280  return true;
281  }
282  return false;
283  }
$path
Definition: aliased.php:25
deletePostFile()
remove existing post file
static initStorage($a_id, $a_subdir=null)
Init file system storage.
setPostFile($a_value)
Set post file.
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilBookingObject::$db
protected

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

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

◆ $description

ilBookingObject::$description
protected

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

Referenced by getDescription().

◆ $id

ilBookingObject::$id
protected

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

Referenced by getId().

◆ $info_file

ilBookingObject::$info_file
protected

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

Referenced by getFile(), and getFileFullPath().

◆ $nr_of_items

ilBookingObject::$nr_of_items
protected

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

Referenced by getNrOfItems().

◆ $pool_id

ilBookingObject::$pool_id
protected

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

Referenced by getPoolId().

◆ $post_file

ilBookingObject::$post_file
protected

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

Referenced by getPostFile(), and getPostFileFullPath().

◆ $post_text

ilBookingObject::$post_text
protected

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

Referenced by getPostText().

◆ $schedule_id

ilBookingObject::$schedule_id
protected

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

Referenced by doClone(), and getScheduleId().

◆ $title

ilBookingObject::$title
protected

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

Referenced by getTitle().


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