setBegin($tsBegin); $this->setEnd($tsEnd); } /***************************************************************************/ /** * @} * @name Access to attributes * @{ */ /** * Set the beginning. Only the time part is used, the date part is ignored. * If the timestamp is invalid, an Exception is thrown. * @param $ts (timestamp) * @throws Exception */ public function setBegin($ts) { if(intval($ts) >= $this->getEnd()) { throw new Exception(MOD_ROOM_RESERVATION_ERROR_END_BEFORE_BEGIN); } else { $this->tsBegin = (intval($ts) % 86400); } } /** * Set the ending. Only the time part is used, the date part is ignored. * If the timestamp is invalid, an Exception is thrown. * @param $ts (timestamp) * @throws Exception */ public function setEnd($ts) { if($this->getBegin() >= intval($ts)) { throw new Exception(MOD_ROOM_RESERVATION_ERROR_END_BEFORE_BEGIN); } else { $this->tsEnd = (intval($ts) % 86400); } } /** * Get the beginning. * @return timestamp */ public function getBegin() { return $this->tsBegin; } /** * Get the ending. * @return timestamp */ public function getEnd() { return $this->tsEnd; } /** @} */ } ?>