ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBookingReservation Class Reference

a booking reservation More...

+ Collaboration diagram for ilBookingReservation:

Public Member Functions

 __construct ($a_id=NULL)
 Constructor.
 getId ()
 Get id.
 setObjectId ($a_object_id)
 Set object id.
 getObjectId ()
 Get object id.
 setUserId ($a_user_id)
 Set booking user id.
 getUserId ()
 Get booking user id.
 setFrom ($a_from)
 Set booking from date.
 getFrom ()
 Get booking from date.
 setTo ($a_to)
 Set booking to date.
 getTo ()
 Get booking to date.
 setStatus ($a_status)
 Set booking status.
 getStatus ()
 Get booking status.
 setGroupId ($a_group_id)
 Set group id.
 getGroupId ()
 Get group id.
 save ()
 Create new entry in db.
 update ()
 Update entry in db.
 delete ()
 Delete single entry.
 getCalendarEntry ()

Static Public Member Functions

static isValidStatus ($a_status)
 Check if given status is valid.
static getNewGroupId ()
 Get next group id.
static getAvailableObject (array $a_ids, $a_from, $a_to, $a_return_single=true, $a_return_counter=false)
 Check if any of given objects are bookable.
static isObjectAvailableNoSchedule ($a_obj_id)
static getCurrentOrUpcomingReservation ($a_object_id)
 Get details about object reservation.
static getObjectReservationForUser ($a_object_id, $a_user_id, $a_multi=false)
static getList ($a_object_ids, $a_limit=10, $a_offset=0, array $filter)
 List all reservations.
static getListByDate ($a_has_schedule, array $a_object_ids, $a_order_field, $a_order_direction, $a_offset, $a_limit, array $filter=null)
 List all reservations by date.
static getUserFilter (array $a_object_ids)
 Get all users who have reservations for object(s)
static changeStatus (array $a_ids, $a_status)
 List all reservations.
static getCancelDetails ($a_obj_id, $a_user_id, $a_from, $a_to)
 Get reservation ids from aggregated id for cancellation.

Data Fields

const STATUS_IN_USE = 2
const STATUS_CANCELLED = 5

Protected Member Functions

 read ()
 Get dataset from db.

Protected Attributes

 $id
 $object_id
 $user_id
 $from
 $to
 $status
 $group_id

Detailed Description

a booking reservation

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.ilBookingReservation.php.

Constructor & Destructor Documentation

ilBookingReservation::__construct (   $a_id = NULL)

Constructor.

if id is given will read dataset from db

Parameters
int$a_id

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

References read().

{
$this->id = (int)$a_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilBookingReservation::changeStatus ( array  $a_ids,
  $a_status 
)
static

List all reservations.

Parameters
array$a_object_ids
int$a_limit
int$a_offset
array$filter
array$a_group_id
Returns
array Batch update reservation status
Parameters
array$a_ids
int$a_status
Returns
bool

Definition at line 910 of file class.ilBookingReservation.php.

References $ilDB.

Referenced by ilObjBookingPoolGUI\changeStatusObject().

{
global $ilDB;
if(self::isValidStatus($a_status))
{
return $ilDB->manipulate('UPDATE booking_reservation'.
' SET status = '.$ilDB->quote($a_status, 'integer').
' WHERE '.$ilDB->in('booking_reservation_id', $a_ids, '', 'integer'));
}
}

+ Here is the caller graph for this function:

ilBookingReservation::delete ( )

Delete single entry.

Returns
bool

Definition at line 261 of file class.ilBookingReservation.php.

References $ilDB.

{
global $ilDB;
if($this->id)
{
return $ilDB->manipulate('DELETE FROM booking_reservation'.
' WHERE booking_reservation_id = '.$ilDB->quote($this->id, 'integer'));
}
}
static ilBookingReservation::getAvailableObject ( array  $a_ids,
  $a_from,
  $a_to,
  $a_return_single = true,
  $a_return_counter = false 
)
static

Check if any of given objects are bookable.

Parameters
array$a_ids
int$a_from
int$a_to
int$a_return_single
Returns
int

Definition at line 291 of file class.ilBookingReservation.php.

References $from, $id, $ilDB, $row, $to, and ilBookingObject\getNrOfItemsForObjects().

Referenced by ilObjBookingPoolGUI\buildDatesBySchedule(), ilObjBookingPoolGUI\confirmedBookingNumbersObject(), and ilObjBookingPoolGUI\confirmedBookingObject().

{
global $ilDB;
$from = $ilDB->quote($a_from, 'integer');
$to = $ilDB->quote($a_to, 'integer');
$set = $ilDB->query('SELECT count(*) cnt, object_id'.
' FROM booking_reservation'.
' WHERE '.$ilDB->in('object_id', $a_ids, '', 'integer').
' AND (status IS NULL OR status <> '.$ilDB->quote(self::STATUS_CANCELLED, 'integer').')'.
' AND ((date_from <= '.$from.' AND date_to >= '.$from.')'.
' OR (date_from <= '.$to.' AND date_to >= '.$to.')'.
' OR (date_from >= '.$from.' AND date_to <= '.$to.'))'.
' GROUP BY object_id');
$blocked = $counter = array();
while($row = $ilDB->fetchAssoc($set))
{
if($row['cnt'] >= $nr_map[$row['object_id']])
{
$blocked[] = $row['object_id'];
}
else if($a_return_counter)
{
$counter[$row['object_id']] = (int)$nr_map[$row['object_id']]-(int)$row['cnt'];
}
}
$available = array_diff($a_ids, $blocked);
if(sizeof($available))
{
if($a_return_counter)
{
foreach($a_ids as $id)
{
if(!isset($counter[$id]))
{
$counter[$id] = (int)$nr_map[$id];
}
}
return $counter;
}
else if($a_return_single)
{
return array_shift($available);
}
else
{
return $available;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBookingReservation::getCalendarEntry ( )

Definition at line 923 of file class.ilBookingReservation.php.

References $ilDB, $row, getId(), and ilCalendarCategory\TYPE_BOOK.

{
global $ilDB;
include_once 'Services/Calendar/classes/class.ilCalendarCategory.php';
$set = $ilDB->query("SELECT ce.cal_id FROM cal_entries ce".
" JOIN cal_cat_assignments cca ON ce.cal_id = cca.cal_id".
" JOIN cal_categories cc ON cca.cat_id = cc.cat_id".
" JOIN booking_reservation br ON ce.context_id = br.booking_reservation_id".
" WHERE cc.obj_id = ".$ilDB->quote($this->getUserId(),'integer').
" AND br.user_id = ".$ilDB->quote($this->getUserId(),'integer').
" AND cc.type = ".$ilDB->quote(ilCalendarCategory::TYPE_BOOK,'integer').
" AND ce.context_id = ".$ilDB->quote($this->getId(), 'integer'));
$row = $ilDB->fetchAssoc($set);
return $row["cal_id"];
}

+ Here is the call graph for this function:

static ilBookingReservation::getCancelDetails (   $a_obj_id,
  $a_user_id,
  $a_from,
  $a_to 
)
static

Get reservation ids from aggregated id for cancellation.

Parameters
int$a_obj_id
int$a_user_id
int$a_from
int$a_to
Returns
array

Definition at line 950 of file class.ilBookingReservation.php.

References $ilDB, $res, and $row.

Referenced by ilObjBookingPoolGUI\rsvConfirmCancelObject().

{
global $ilDB;
$res = array();
$sql = "SELECT booking_reservation_id".
" FROM booking_reservation".
" WHERE object_id = ".$ilDB->quote($a_obj_id, "integer").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND date_from = ".$ilDB->quote($a_from, "integer").
" AND date_to = ".$ilDB->quote($a_to, "integer").
" AND (status IS NULL".
" OR status <> ".$ilDB->quote(self::STATUS_CANCELLED, "integer").")";
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row["booking_reservation_id"];
}
return $res;
}

+ Here is the caller graph for this function:

static ilBookingReservation::getCurrentOrUpcomingReservation (   $a_object_id)
static

Get details about object reservation.

Parameters
int$a_object_id
Returns
array

Definition at line 368 of file class.ilBookingReservation.php.

References $ilDB, and $row.

{
global $ilDB;
$now = $ilDB->quote(time(), 'integer');
$ilDB->setLimit(1);
$set = $ilDB->query('SELECT user_id, status, date_from, date_to'.
' FROM booking_reservation'.
' WHERE ((date_from <= '.$now.' AND date_to >= '.$now.')'.
' OR date_from > '.$now.')'.
' AND (status <> '.$ilDB->quote(self::STATUS_CANCELLED, 'integer').
' OR STATUS IS NULL) AND object_id = '.$ilDB->quote($a_object_id, 'integer').
' ORDER BY date_from');
$row = $ilDB->fetchAssoc($set);
return $row;
}
ilBookingReservation::getFrom ( )

Get booking from date.

Returns
int

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

References $from.

Referenced by save().

{
return $this->from;
}

+ Here is the caller graph for this function:

ilBookingReservation::getGroupId ( )

Get group id.

Returns
int

Definition at line 171 of file class.ilBookingReservation.php.

References $group_id.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilBookingReservation::getId ( )

Get id.

Returns
int

Definition at line 42 of file class.ilBookingReservation.php.

References $id.

Referenced by getCalendarEntry().

{
return $this->id;
}

+ Here is the caller graph for this function:

static ilBookingReservation::getList (   $a_object_ids,
  $a_limit = 10,
  $a_offset = 0,
array  $filter 
)
static

List all reservations.

Parameters
array$a_object_ids
int$a_limit
int$a_offset
array$a_offset
Returns
array

Definition at line 419 of file class.ilBookingReservation.php.

References $ilDB, $res, and $row.

Referenced by ilBookingObjectsTableGUI\getItems().

{
global $ilDB;
$sql = 'SELECT r.*,o.title'.
' FROM booking_reservation r'.
' JOIN booking_object o ON (o.booking_object_id = r.object_id)';
$count_sql = 'SELECT COUNT(*) AS counter'.
' FROM booking_reservation r'.
' JOIN booking_object o ON (o.booking_object_id = r.object_id)';
$where = array($ilDB->in('r.object_id', $a_object_ids, '', 'integer'));
if($filter['status'])
{
if($filter['status'] > 0)
{
$where[] = 'status = '.$ilDB->quote($filter['status'], 'integer');
}
else
{
$where[] = '(status != '.$ilDB->quote(-$filter['status'], 'integer').
' OR status IS NULL)';
}
}
if($filter['from'])
{
$where[] = 'date_from >= '.$ilDB->quote($filter['from'], 'integer');
}
if($filter['to'])
{
$where[] = 'date_to <= '.$ilDB->quote($filter['to'], 'integer');
}
if(sizeof($where))
{
$sql .= ' WHERE '.implode(' AND ', $where);
$count_sql .= ' WHERE '.implode(' AND ', $where);
}
$set = $ilDB->query($count_sql);
$row = $ilDB->fetchAssoc($set);
$counter = $row['counter'];
$sql .= ' ORDER BY date_from DESC, booking_reservation_id DESC';
$ilDB->setLimit($a_limit, $a_offset);
$set = $ilDB->query($sql);
$res = array();
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row;
}
return array('data'=>$res, 'counter'=>$counter);
}

+ Here is the caller graph for this function:

static ilBookingReservation::getListByDate (   $a_has_schedule,
array  $a_object_ids,
  $a_order_field,
  $a_order_direction,
  $a_offset,
  $a_limit,
array  $filter = null 
)
static

List all reservations by date.

Parameters
bool$a_has_schedule
array$a_object_ids
string$a_order_field
string$a_order_direction
int$a_offset
int$a_limit
array$filter
Returns
array

Definition at line 486 of file class.ilBookingReservation.php.

References $ilDB, $res, $row, $size, $user_id, ilObjUser\_lookupName(), ilUtil\sortArray(), and STATUS_CANCELLED.

Referenced by ilBookingReservationsTableGUI\getItems().

{
global $ilDB;
$res = array();
$sql = 'SELECT r.*, o.title'.
' FROM booking_reservation r'.
' JOIN booking_object o ON (o.booking_object_id = r.object_id)';
$where = array($ilDB->in('object_id', $a_object_ids, '', 'integer'));
if($filter['status'])
{
if($filter['status'] > 0)
{
$where[] = 'status = '.$ilDB->quote($filter['status'], 'integer');
}
else
{
$where[] = '(status != '.$ilDB->quote(-$filter['status'], 'integer').
' OR status IS NULL)';
}
}
if($a_has_schedule)
{
if($filter['from'])
{
$where[] = 'date_from >= '.$ilDB->quote($filter['from'], 'integer');
}
if($filter['to'])
{
$where[] = 'date_to <= '.$ilDB->quote($filter['to'], 'integer');
}
}
if($filter['user_id']) // #16584
{
$where[] = 'user_id = '.$ilDB->quote($filter['user_id'], 'integer');
}
/*
if($a_group_id)
{
$where[] = 'group_id = '.$ilDB->quote(substr($a_group_id, 1), 'integer');
}
*/
if(sizeof($where))
{
$sql .= ' WHERE '.implode(' AND ', $where);
}
if($a_has_schedule)
{
$sql .= ' ORDER BY date_from DESC';
}
else
{
// #16155 - could be cancelled and re-booked
$sql .= ' ORDER BY status';
}
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$obj_id = $row["object_id"];
$user_id = $row["user_id"];
if($a_has_schedule)
{
$slot = $row["date_from"]."_".$row["date_to"];
$idx = $obj_id."_".$user_id."_".$slot;
}
else
{
$idx = $obj_id."_".$user_id;
}
if($a_has_schedule && $filter["slot"])
{
$slot_idx = date("w", $row["date_from"])."_".date("H:i", $row["date_from"]).
"-".date("H:i", $row["date_to"]+1);
if($filter["slot"] != $slot_idx)
{
continue;
}
}
if(!isset($res[$idx]))
{
$res[$idx] = array(
"object_id" => $obj_id
,"title" => $row["title"]
,"user_id" => $user_id
,"counter" => 1
,"user_name" => $uname["lastname"].", ".$uname["firstname"] // #17862
);
if($a_has_schedule)
{
$res[$idx]["booking_reservation_id"] = $idx;
$res[$idx]["date"] = date("Y-m-d", $row["date_from"]);
$res[$idx]["slot"] = date("H:i", $row["date_from"])." - ".
date("H:i", $row["date_to"]+1);
$res[$idx]["week"] = date("W", $row["date_from"]);
$res[$idx]["weekday"] = date("w", $row["date_from"]);
$res[$idx]["can_be_cancelled"] = ($row["status"] != self::STATUS_CANCELLED &&
$row["date_from"] > time());
$res[$idx]["_sortdate"] = $row["date_from"];
}
else
{
$res[$idx]["booking_reservation_id"] = $row["booking_reservation_id"];
$res[$idx]["status"] = $row["status"];
$res[$idx]["can_be_cancelled"] = ($row["status"] != self::STATUS_CANCELLED);
}
}
else
{
$res[$idx]["counter"]++;
}
}
$size = sizeof($res);
// order
$numeric = in_array($a_order_field, array("counter", "date", "week", "weekday"));
// #16560 - this will enable matchting slot sorting to date/week
if($a_has_schedule &&
in_array($a_order_field, array("date", "week")))
{
$a_order_field = "_sortdate";
}
$res = ilUtil::sortArray($res, $a_order_field, $a_order_direction, $numeric);
// offset/limit
$res = array_splice($res, $a_offset, $a_limit);
return array("data"=>$res, "counter"=>$size);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBookingReservation::getNewGroupId ( )
static

Get next group id.

Returns
int

Definition at line 276 of file class.ilBookingReservation.php.

References $ilDB.

Referenced by ilObjBookingPoolGUI\confirmedBookingObject().

{
global $ilDB;
return $ilDB->nextId('booking_reservation_group');
}

+ Here is the caller graph for this function:

ilBookingReservation::getObjectId ( )

Get object id.

Returns
int

Definition at line 60 of file class.ilBookingReservation.php.

References $object_id.

Referenced by save().

{
}

+ Here is the caller graph for this function:

static ilBookingReservation::getObjectReservationForUser (   $a_object_id,
  $a_user_id,
  $a_multi = false 
)
static

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

References $ilDB, $res, and $row.

Referenced by ilObjBookingPoolGUI\confirmedBookingObject(), ilBookingObjectGUI\deliverPostFile(), ilBookingObjectGUI\displayPostInfo(), and ilBookingObjectGUI\rsvCancelUser().

{
global $ilDB;
$set = $ilDB->query('SELECT booking_reservation_id FROM booking_reservation'.
' WHERE user_id = '.$ilDB->quote($a_user_id, 'integer').
' AND object_id = '.$ilDB->quote($a_object_id, 'integer').
' AND (status <> '.$ilDB->quote(self::STATUS_CANCELLED, 'integer').
' OR STATUS IS NULL)');
if(!$a_multi)
{
$row = $ilDB->fetchAssoc($set);
return $row['booking_reservation_id'];
}
else
{
$res = array();
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row['booking_reservation_id'];
}
return $res;
}
}

+ Here is the caller graph for this function:

ilBookingReservation::getStatus ( )

Get booking status.

Returns
int

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

References $status.

Referenced by save().

{
return $this->status;
}

+ Here is the caller graph for this function:

ilBookingReservation::getTo ( )

Get booking to date.

Returns
int

Definition at line 114 of file class.ilBookingReservation.php.

References $to.

Referenced by save().

{
return $this->to;
}

+ Here is the caller graph for this function:

static ilBookingReservation::getUserFilter ( array  $a_object_ids)
static

Get all users who have reservations for object(s)

Parameters
array$a_object_ids
Returns
array

Definition at line 634 of file class.ilBookingReservation.php.

References $ilDB, $res, and $row.

Referenced by ilBookingReservationsTableGUI\initFilter().

{
global $ilDB;
$res = array();
$sql = "SELECT ud.usr_id,ud.lastname,ud.firstname,ud.login".
" FROM usr_data ud ".
" LEFT JOIN booking_reservation r ON (r.user_id = ud.usr_id)".
" WHERE ud.usr_id <> ".$ilDB->quote(ANONYMOUS_USER_ID, "integer").
" AND ".$ilDB->in("r.object_id", $a_object_ids, "", "integer").
" ORDER BY ud.lastname,ud.firstname";
$set = $ilDB->query($sql);
while($row = $ilDB->fetchAssoc($set))
{
$res[$row["usr_id"]] = $row["lastname"].", ".$row["firstname"].
" (".$row["login"].")";
}
return $res;
}

+ Here is the caller graph for this function:

ilBookingReservation::getUserId ( )

Get booking user id.

Returns
int

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

References $user_id.

Referenced by save().

{
}

+ Here is the caller graph for this function:

static ilBookingReservation::isObjectAvailableNoSchedule (   $a_obj_id)
static

Definition at line 345 of file class.ilBookingReservation.php.

References $ilDB, and ilBookingObject\getNrOfItemsForObjects().

Referenced by ilObjBookingPoolGUI\confirmedBookingObject().

{
global $ilDB;
$all = ilBookingObject::getNrOfItemsForObjects(array($a_obj_id));
$all = (int)$all[$a_obj_id];
$set = $ilDB->query('SELECT COUNT(*) cnt'.
' FROM booking_reservation r'.
' JOIN booking_object o ON (o.booking_object_id = r.object_id)'.
' WHERE (status IS NULL OR status <> '.$ilDB->quote(self::STATUS_CANCELLED, 'integer').')'.
' AND r.object_id = '.$ilDB->quote($a_obj_id, 'integer'));
$cnt = $ilDB->fetchAssoc($set);
$cnt = (int)$cnt['cnt'];
return (bool)($all-$cnt); // #11864
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBookingReservation::isValidStatus (   $a_status)
static

Check if given status is valid.

Parameters
int$a_status
Returns
bool

Definition at line 149 of file class.ilBookingReservation.php.

Referenced by setStatus().

{
if(in_array($a_status, array(self::STATUS_IN_USE, self::STATUS_CANCELLED)))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilBookingReservation::read ( )
protected

Get dataset from db.

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

References $ilDB, $row, setFrom(), setGroupId(), setObjectId(), setStatus(), setTo(), and setUserId().

Referenced by __construct().

{
global $ilDB;
if($this->id)
{
$set = $ilDB->query('SELECT *'.
' FROM booking_reservation'.
' WHERE booking_reservation_id = '.$ilDB->quote($this->id, 'integer'));
$row = $ilDB->fetchAssoc($set);
$this->setUserId($row['user_id']);
$this->setObjectId($row['object_id']);
$this->setFrom($row['date_from']);
$this->setTo($row['date_to']);
$this->setStatus($row['status']);
$this->setGroupId($row['group_id']);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBookingReservation::save ( )

Create new entry in db.

Returns
bool

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

References $ilDB, getFrom(), getGroupId(), getObjectId(), getStatus(), getTo(), and getUserId().

{
global $ilDB;
if($this->id)
{
return false;
}
$this->id = $ilDB->nextId('booking_reservation');
return $ilDB->manipulate('INSERT INTO booking_reservation'.
' (booking_reservation_id,user_id,object_id,date_from,date_to,status,group_id)'.
' VALUES ('.$ilDB->quote($this->id, 'integer').
','.$ilDB->quote($this->getUserId(), 'integer').
','.$ilDB->quote($this->getObjectId(), 'integer').
','.$ilDB->quote($this->getFrom(), 'integer').
','.$ilDB->quote($this->getTo(), 'integer').
','.$ilDB->quote($this->getStatus(), 'integer').
','.$ilDB->quote($this->getGroupId(), 'integer').')');
}

+ Here is the call graph for this function:

ilBookingReservation::setFrom (   $a_from)

Set booking from date.

Parameters
int$a_from

Definition at line 87 of file class.ilBookingReservation.php.

Referenced by read().

{
$this->from = (int)$a_from;
}

+ Here is the caller graph for this function:

ilBookingReservation::setGroupId (   $a_group_id)

Set group id.

Parameters
int$a_group_id

Definition at line 162 of file class.ilBookingReservation.php.

Referenced by read().

{
$this->group_id = $a_group_id;
}

+ Here is the caller graph for this function:

ilBookingReservation::setObjectId (   $a_object_id)

Set object id.

Parameters
int$a_object_id

Definition at line 51 of file class.ilBookingReservation.php.

Referenced by read().

{
$this->object_id = $a_object_id;
}

+ Here is the caller graph for this function:

ilBookingReservation::setStatus (   $a_status)

Set booking status.

Parameters
int$a_status

Definition at line 123 of file class.ilBookingReservation.php.

References isValidStatus().

Referenced by ilCalendarAppointmentGUI\cancelConfirmed(), and read().

{
if($a_status === NULL)
{
$this->status = NULL;
}
if($this->isValidStatus((int)$a_status))
{
$this->status = (int)$a_status;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBookingReservation::setTo (   $a_to)

Set booking to date.

Parameters
int$a_to

Definition at line 105 of file class.ilBookingReservation.php.

Referenced by read().

{
$this->to = (int)$a_to;
}

+ Here is the caller graph for this function:

ilBookingReservation::setUserId (   $a_user_id)

Set booking user id.

Parameters
int$a_user_id

Definition at line 69 of file class.ilBookingReservation.php.

Referenced by read().

{
$this->user_id = (int)$a_user_id;
}

+ Here is the caller graph for this function:

ilBookingReservation::update ( )

Update entry in db.

Returns
bool

Definition at line 228 of file class.ilBookingReservation.php.

References $ilDB.

{
global $ilDB;
if(!$this->id)
{
return false;
}
/* there can only be 1
if($this->getStatus() == self::STATUS_IN_USE)
{
$ilDB->manipulate('UPDATE booking_reservation'.
' SET status = '.$ilDB->quote(NULL, 'integer').
' WHERE object_id = '.$ilDB->quote($this->getObjectId(), 'integer').
' AND status = '.$ilDB->quote(self::STATUS_IN_USE, 'integer'));
}
*/
return $ilDB->manipulate('UPDATE booking_reservation'.
' SET object_id = '.$ilDB->quote($this->getObjectId(), 'text').
', user_id = '.$ilDB->quote($this->getUserId(), 'integer').
', date_from = '.$ilDB->quote($this->getFrom(), 'integer').
', date_to = '.$ilDB->quote($this->getTo(), 'integer').
', status = '.$ilDB->quote($this->getStatus(), 'integer').
', group_id = '.$ilDB->quote($this->getGroupId(), 'integer').
' WHERE booking_reservation_id = '.$ilDB->quote($this->id, 'integer'));
}

Field Documentation

ilBookingReservation::$from
protected

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

Referenced by getAvailableObject(), and getFrom().

ilBookingReservation::$group_id
protected

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

Referenced by getGroupId().

ilBookingReservation::$id
protected

Definition at line 14 of file class.ilBookingReservation.php.

Referenced by getAvailableObject(), and getId().

ilBookingReservation::$object_id
protected

Definition at line 15 of file class.ilBookingReservation.php.

Referenced by getObjectId().

ilBookingReservation::$status
protected

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

Referenced by getStatus().

ilBookingReservation::$to
protected

Definition at line 18 of file class.ilBookingReservation.php.

Referenced by getAvailableObject(), and getTo().

ilBookingReservation::$user_id
protected

Definition at line 16 of file class.ilBookingReservation.php.

Referenced by getListByDate(), and getUserId().


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