+++ /dev/null
-<?php
-/**
- * @file mod_roomReservationBooking.inc
- * Container class for the representation of a single booking
- * @author Roland Hieber (roland.hieber@wilhelm-gym.net)
- * @date 12.11.2007
- *
- * Copyright © 2007 Roland Hieber
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-/** @todo document */
-/**
- * Container class for the representation of a single booking
- */
-class mod_roomReservationBooking {
-
- /** (int / null) Unique ID in database */
- protected $nUid;
- /** (string) Name of the room */
- protected $strRoom;
- /** (timestamp) Date when the booking takes place */
- protected $tsDate;
- /** (int) Number of the first timeslice */
- protected $nTsFirst;
- /** (int) Number of the last timeslice (may be nBegin) */
- protected $nTsLast;
- /** (string) Account name of the owner */
- protected $strAct;
- /** (string) Reason for the booking */
- protected $strReason;
- /** (bool) Recurrence interval in weeks */
- protected $nInterval;
-
- /***************************************************************************/
- /**
- * @name Constructor
- * @{
- */
- /**
- * Constructor.
- * @param $strRoom (string) Name of the room
- * @param $tsDate (timestamp) Date when the booking takes place
- * @param $nTsFirst (int) Number of the first timeslice
- * @param $nTsLast (int) Number of the last timeslice (may be nBegin)
- * @param $strAct (string) Account name of the owner
- * @param $strReason (string) Reason for the booking
- * @param $nInterval (int) Recurrence interval, 0 for no recurrence
- * @return mod_roomReservationBooking
- */
- public function __construct($strRoom, $tsDate, $nTsFirst, $nTsLast, $strAct,
- $strReason, $nInterval = 0) {
- $this->setUid(null);
- $this->setRoom($strRoom);
- $this->setDate($tsDate);
- $this->setTsFirst($nTsFirst);
- $this->setTsLast($nTsLast);
- $this->setAct($strAct);
- $this->setReason($strReason);
- $this->setInterval($nInterval);
- }
-
- /***************************************************************************/
- /**
- * @}
- * @name Access to attributes
- * @{
- */
-
- /**
- * Set the unique ID in database
- * @param $n (int) Unique ID in database
- * @return void
- */
- public function setUid($n) {
- if(is_null($n)) {
- $this->nUid = null;
- } else {
- $this->nUid = intval($n);
- }
- }
-
- /**
- * Set the name of the room
- * @param $str (string) Name of the room
- * @return void
- */
- public function setRoom($str) { $this->strRoom = $str; }
-
- /**
- * Set the date when the booking takes place
- * @param $ts (timestamp) Date, only the date part is taken care of
- * @return void
- */
- public function setDate($ts) {
- // Only take the date part
- $this->tsDate = intval(strtotime(date("Y\-m\-d", intval($ts)))); }
-
- /**
- * Set the first timeslice
- * @param $n (int) Number of the first timeslice
- * @return void
- */
- public function setTsFirst($n) { $this->nTsFirst = intval($n); }
-
- /**
- * Set the end timeslice
- * @param $n (int) Number of the last timeslice (may be the start timeslice)
- * @return void
- */
- public function setTsLast($n) { $this->nTsLast = intval($n); }
-
- /**
- * Set the account name of the owner
- * @param $str (string) Account name
- * @return void
- */
- public function setAct($str) { $this->strAct = $str; }
-
- /**
- * Set the reason for the booking
- * @param $str (string) Reason
- * @return void
- */
- public function setReason($str) { $this->strReason = $str; }
-
- /**
- * Set the flag whether the booking repeates every week
- * @param $n (int) interval in weeks, 0 for no recurrence
- * @return void
- */
- public function setInterval($n) { $this->nInterval = intval(abs($n)); }
-
- /**
- * Get the unique ID in database
- * @return int / null
- */
- public function getUid() { return intval($this->nUid); }
-
- /**
- * Get the name of the room
- * @return string
- */
- public function getRoom() { return $this->strRoom; }
-
- /**
- * Get the date when the booking takes place
- * @return timestamp
- */
- public function getDate() { return intval($this->tsDate); }
-
- /**
- * Get the the number of the first timeslice
- * @return int
- */
- public function getTsFirst() { return intval($this->nTsFirst); }
-
- /**
- * Get the number of the last timeslice (may be the start timeslice)
- * @return int
- */
- public function getTsLast() { return intval($this->nTsLast); }
-
- /**
- * Get the account name of the owner
- * @return string
- */
- public function getAct() { return $this->strAct; }
-
- /**
- * Get the reason for the booking
- * @return string
- */
- public function getReason() { return $this->strReason; }
-
- /**
- * Get the recurrence interval
- * @return int
- */
- public function getInterval() { return $this->nInterval; }
-
- /**@}*/
-}
-?>