41    public function __construct($a_id = 0, $a_call_by_reference = 
true)
 
   45        $this->db = 
$DIC->database();
 
   58            "pool_offline" => array(
"integer", $this->
isOffline()),
 
   79        $new_id = parent::create();
 
   82        $fields[
"booking_pool_id"] = array(
"integer", $new_id);
 
   84        $ilDB->insert(
"booking_settings", $fields);
 
   97        if (!parent::update()) {
 
  102        if ($this->
getId()) {
 
  106                array(
"booking_pool_id" => array(
"integer", $this->
getId()))
 
  120        if ($this->
getId()) {
 
  121            $set = 
$ilDB->query(
'SELECT * FROM booking_settings' .
 
  122                ' WHERE booking_pool_id = ' . 
$ilDB->quote($this->getId(), 
'integer'));
 
  123            $row = 
$ilDB->fetchAssoc($set);
 
  148            "SELECT * FROM booking_settings " .
 
  149            " WHERE reminder_status = %s " .
 
  150            " AND reminder_day > %s " .
 
  151            " AND pool_offline = %s ",
 
  152            array(
"integer",
"integer",
"integer"),
 
  155        while ($rec = 
$db->fetchAssoc($set)) {
 
  171        $db->update(
"booking_settings", array(
 
  172                "last_remind_ts" => array(
"integer", $a_ts)
 
  174                "booking_pool_id" => array(
"integer", $a_obj_id)
 
  183    public function delete()
 
  190        if (!parent::delete()) {
 
  196        $ilDB->manipulate(
'DELETE FROM booking_settings' .
 
  197                ' WHERE booking_pool_id = ' . 
$ilDB->quote(
$id, 
'integer'));
 
  199        $ilDB->manipulate(
'DELETE FROM booking_schedule' .
 
  200                ' WHERE pool_id = ' . 
$ilDB->quote(
$id, 
'integer'));
 
  203        $set = 
$ilDB->query(
'SELECT booking_object_id FROM booking_object' .
 
  204            ' WHERE pool_id = ' . 
$ilDB->quote(
$id, 
'integer'));
 
  205        while ($row = 
$ilDB->fetchAssoc($set)) {
 
  206            $objects[] = $row[
'booking_object_id'];
 
  209        if (
sizeof($objects)) {
 
  210            $ilDB->manipulate(
'DELETE FROM booking_reservation' .
 
  211                    ' WHERE ' . 
$ilDB->in(
'object_id', $objects, 
'', 
'integer'));
 
  214        $ilDB->manipulate(
'DELETE FROM booking_object' .
 
  215            ' WHERE pool_id = ' . 
$ilDB->quote(
$id, 
'integer'));
 
  220    public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = 
false)
 
  222        $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
 
  227        if (!$cp_options->isRootNode($this->getRefId())) {
 
  228            $new_obj->setOffline($this->
isOffline());
 
  244                $smap[$item[
"booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
 
  251            $bobj->doClone($new_obj->getId(), $smap);
 
  265        $this->offline = (bool) $a_value;
 
  283        $this->public_log = (bool) $a_value;
 
  301        $this->schedule_type = (int) $a_value;
 
  320        $this->reminder_status = $a_val;
 
  340        $this->reminder_day = $a_val;
 
  360        $this->preference_nr = $a_val;
 
  380        $this->pref_deadline = $a_val;
 
  407        $set = 
$ilDB->query(
"SELECT pool_offline" .
 
  408            " FROM booking_settings" .
 
  409            " WHERE booking_pool_id = " . 
$ilDB->quote($a_obj_id, 
"integer"));
 
  410        $row = 
$ilDB->fetchAssoc($set);
 
  411        return !(bool) $row[
"pool_offline"];
 
  421        if ($a_value !== 
null) {
 
  422            $a_value = (int) $a_value;
 
  424        $this->overall_limit = $a_value;
 
  444        if ($a_value !== 
null) {
 
  445            $a_value = (int) $a_value;
 
  447        $this->reservation_period = $a_value;
 
  471        foreach ($recs as $record_obj) {
 
  473                $fields[$def->getFieldId()] = array(
 
  474                    "id" => $def->getFieldId(),
 
  475                    "title" => $def->getTitle(),
 
  476                    "type" => $def->getType()
 
An exception for terminatinating execution or to throw for unit testing.
static getInstancesByRecordId($a_record_id, $a_only_searchable=false)
Get definitions by record id.
static _getSelectedRecordsByObject($a_obj_type, $a_ref_id, $a_sub_type="")
Get selected records by object.
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type.
schedule for booking ressource
static getList($a_pool_id)
Get list of booking objects for given pool.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static writeLastReminderTimestamp($a_obj_id, $a_ts)
Write last reminder timestamp.
static getAdvancedMDFields($a_ref_id)
setOffline($a_value=true)
Toggle offline property.
setScheduleType($a_value)
Set schedule type.
__construct($a_id=0, $a_call_by_reference=true)
Constructor.
getReminderDay()
Get reminder day.
getPreferenceNumber()
Get preference number.
getDBFields()
Parse properties for sql statements.
setReservationFilterPeriod($a_value=null)
Set reservation filter period default.
getScheduleType()
Get schedule type.
read()
read object data from db into object
setReminderStatus($a_val)
Set reminder status.
const TYPE_NO_SCHEDULE_PREFERENCES
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
isOffline()
Get offline property.
setReminderDay($a_val)
Set reminder day.
update()
update object data
setPublicLog($a_value=true)
Toggle public log property.
getPreferenceDeadline()
Get preference deadline.
setPreferenceNumber($a_val)
Set preference number.
hasPublicLog()
Get public log property.
static _lookupOnline($a_obj_id)
Check object status.
getReminderStatus()
Get reminder status.
getOverallLimit()
Get overall / global booking limit.
setOverallLimit($a_value=null)
Set overall / global booking limit.
getReservationFilterPeriod()
Get reservation filter period default.
setPreferenceDeadline($a_val)
Set preference deadline.
static getPoolsWithReminders()
Get poos with reminders.
Class ilObject Basic functions for all objects.
getId()
get object id @access public
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc