当前位置: 首页>>代码示例>>PHP>>正文


PHP Room类代码示例

本文整理汇总了PHP中Room的典型用法代码示例。如果您正苦于以下问题:PHP Room类的具体用法?PHP Room怎么用?PHP Room使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Room类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionLogout

 /**
  * Destroy user session
  */
 public function actionLogout()
 {
     try {
         // we might not be signed in actually
         $this->user = new User();
     } catch (UserNotAuthenticatedException $e) {
         $this->flashSuccess = 'You are already logged out';
     }
     // as we are logging out, leave us from all rooms
     if ($this->user != NULL) {
         $inRooms = $this->user->inRooms();
         if (!empty($inRooms)) {
             $time = mktime();
             foreach ($inRooms as $room) {
                 // message about it
                 $message = new MessageSpeak($room, $time);
                 $message->leave($room, $time, $this->user->getShortName());
             }
             // remove us from participants
             $room = new Room();
             $room->removeParticipant($this->user->getId());
         }
         $this->flashSuccess = 'You have been logged out';
         $this->user->signOut();
     }
     $this->bag->token = Fari_FormToken::create();
     $this->renderAction('login');
 }
开发者ID:radekstepan,项目名称:Clubhouse,代码行数:31,代码来源:AuthPresenter.php

示例2: Room

 /**
  * Internal function to return a Room object from a row.
  * @param $row array
  * @return Room
  */
 function &_returnRoomFromRow(&$row)
 {
     $room = new Room();
     $room->setId($row['room_id']);
     $room->setBuildingId($row['building_id']);
     $this->getDataObjectSettings('room_settings', 'room_id', $row['room_id'], $room);
     return $room;
 }
开发者ID:jalperin,项目名称:ocs,代码行数:13,代码来源:RoomDAO.inc.php

示例3: joinRoom

 public function joinRoom(Room $room)
 {
     if ($room->isFull()) {
         return;
     }
     $this->room = $room;
     $room->addPlayer($this);
 }
开发者ID:Koridev,项目名称:PixelDraw-Server,代码行数:8,代码来源:Player.php

示例4: select_group

 public function select_group()
 {
     $group_id = $this->input->post('group_id');
     $this->_transaction_isolation();
     $this->db->trans_begin();
     $group = new Group();
     $group->get_by_id($group_id);
     if ($group->exists()) {
         $course = $group->course->get();
         if (is_null($course->groups_change_deadline) || date('U', strtotime($course->groups_change_deadline)) >= time()) {
             $student = new Student();
             $student->get_by_id($this->usermanager->get_student_id());
             if ($student->is_related_to('active_course', $course->id)) {
                 $participant = new Participant();
                 $participant->where_related($student);
                 $participant->where_related($course);
                 $participant->where('allowed', 1);
                 $participant->get();
                 if ($participant->exists()) {
                     if (!$participant->is_related_to($group)) {
                         $participant->save($group);
                         $participant->where_related($course);
                         $participant->where_related($group);
                         $participant->where('allowed', 1);
                         $participants_count = $participant->count();
                         $room = new Room();
                         $room->where_related($group)->order_by('capacity', 'asc')->limit(1)->get();
                         if ($participants_count > intval($room->capacity)) {
                             $this->db->trans_rollback();
                             $this->messages->add_message('lang:groups_message_group_is_full', Messages::MESSAGE_TYPE_ERROR);
                         } else {
                             $this->db->trans_commit();
                             $this->messages->add_message(sprintf($this->lang->line('groups_message_group_changed'), $this->lang->text($group->name)), Messages::MESSAGE_TYPE_SUCCESS);
                             $this->_action_success();
                             $this->output->set_internal_value('course_id', $participant->course_id);
                         }
                     } else {
                         $this->db->trans_rollback();
                         $this->messages->add_message('lang:groups_message_you_are_in_group', Messages::MESSAGE_TYPE_ERROR);
                     }
                 } else {
                     $this->db->trans_rollback();
                     $this->messages->add_message('lang:groups_message_cant_found_participant_record', Messages::MESSAGE_TYPE_ERROR);
                 }
             } else {
                 $this->db->trans_rollback();
                 $this->messages->add_message('lang:groups_message_cant_change_group_of_inactive_course', Messages::MESSAGE_TYPE_ERROR);
             }
         } else {
             $this->db->trans_rollback();
             $this->messages->add_message('lang:groups_message_groups_switching_disabled', Messages::MESSAGE_TYPE_ERROR);
         }
     } else {
         $this->db->trans_rollback();
         $this->messages->add_message('lang:groups_message_group_not_found', Messages::MESSAGE_TYPE_ERROR);
     }
     redirect(create_internal_url('groups'));
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:58,代码来源:groups.php

示例5: bookRoom

 static function bookRoom(Room $room, Reservation $reservation)
 {
     $room->addReservation($reservation);
     $roomNumber = $room->getRoomInfo()->getRoomNumber();
     $guest = $reservation->getGuest()->getFullName();
     $start = $reservation->getStartDate();
     $end = $reservation->getEndDate();
     echo "Room <strong>{$roomNumber}</strong> successfully booked for <strong>{$guest}</strong> from <time>{$start}</time> to <time>{$end}</time>!";
 }
开发者ID:reminchev,项目名称:SoftUni-Projects,代码行数:9,代码来源:BookingManager.class.php

示例6: bookRoom

 public static function bookRoom(Room $room, Reservation $reservation)
 {
     try {
         $room->addReservation($reservation);
         echo "\nRoom " . $room->getRoomNumber() . " successfully booked for " . $reservation->getGuest()->getFullName() . " from " . $reservation->getStartDate()->format("d-m-y") . " to " . $reservation->getEndDate()->format("d-m-y");
     } catch (EReservationException $ex) {
         echo PHP_EOL . $ex->getMessage();
     }
 }
开发者ID:TzvetanIG,项目名称:OOP,代码行数:9,代码来源:BookManager.class.php

示例7: bookRoom

 public static function bookRoom(Room $room, Reservation $reservation)
 {
     try {
         $room->addReservation($reservation);
         $output = "Room <strong>{$room->getRoomNumber()}</strong> successfully booked for " . "<strong>{$reservation->getGuest()}</strong> from " . "<time>{$reservation->getStartDate()->format("d.m.Y")}</time> to " . "<time>{$reservation->getEndDate()->format("d.m.Y")}</time>!";
         echo $output;
     } catch (EReservationException $e) {
         echo $e->getMessage();
     }
 }
开发者ID:AmaranthInHell,项目名称:SoftUni,代码行数:10,代码来源:BookingManager.class.php

示例8: isEmpty

function isEmpty(Room $room)
{
    $quest = new Guest("G", "R", 89466466);
    $reservation = new Reservation("15-10-2014", "18-10-2014", $quest);
    try {
        $room->checkForValidReservation($reservation);
        return true;
    } catch (EReservationException $ex) {
        return false;
    }
}
开发者ID:SGStoyanov,项目名称:SoftUni,代码行数:11,代码来源:HotelReservationTester.php

示例9: doDelete

function doDelete()
{
    @($id = $_POST['selector']);
    $key = count($id);
    //multi delete using checkbox as a selector
    for ($i = 0; $i < $key; $i++) {
        $room = new Room();
        $room->delete($id[$i]);
    }
    message("Room(s) already Deleted!", "info");
    redirect('index.php');
}
开发者ID:allybitebo,项目名称:CCECourseCatalogue,代码行数:12,代码来源:controller.php

示例10: bookRoom

 static function bookRoom(Room $room, Reservation $reservation)
 {
     try {
         $room->addReservation($reservation);
         $startDate = $reservation->getStartDate();
         $endDate = $reservation->getEndDate();
         $guestName = $reservation->getGuest()->getFistName() . " " . $reservation->getGuest()->getLastName();
         echo "\nRoom <strong>" . $room->getRoomId() . "</strong> successfully booked for <strong>" . $guestName . "</strong> from <time>" . date_format($startDate, "d-m-y") . "</time> to <time>" . date_format($endDate, "d-m-y") . "</time>!</br>";
     } catch (EReservationException $ex) {
         echo $ex->getMessage();
     }
 }
开发者ID:nok32,项目名称:SoftUni,代码行数:12,代码来源:BookingManager.class.php

示例11: executeAdd

 public function executeAdd(sfWebRequest $request)
 {
     if ($request->isMethod('Post')) {
         $room = new Room();
         $room->setTitle($this->getRequestParameter('title'));
         $room->setPrice($this->getRequestParameter('price'));
         $room->setStatus(Constant::BED_AVAILABLE);
         $room->save();
         $this->getUser()->setFlash('SUCCESS_MESSAGE', Constant::RECORD_ADDED_SUCCESSFULLY);
         $this->redirect('Room/list');
     }
     //end if
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:13,代码来源:actions.class.php

示例12: bookRoom

 public static function bookRoom(Room $room, Reservation $reservation)
 {
     try {
         $room->addReservation($reservation);
         $successMessage = "Room <strong>" . $room->getRoomNumber() . "</strong> successfully booked ";
         $successMessage .= "for <strong>" . $reservation->getGuest();
         $successMessage .= "</strong> from <time>" . $reservation->getStarDate()->format("d.m.Y") . "</time> ";
         $successMessage .= "to <time>" . $reservation->getEndDate()->format("d.m.Y") . "</time>!";
         $successMessage .= "</br>";
         echo $successMessage;
     } catch (EReservationException $ex) {
         echo "<strong>Operation failed.</strong> " . $ex->getMessage() . "</br>";
         return;
     }
 }
开发者ID:AmaranthInHell,项目名称:SoftUni-1,代码行数:15,代码来源:BookingManager.class.php

示例13: deleteRoom

 public function deleteRoom($buildingid, $id)
 {
     //
     $room = Room::find($id);
     $room->delete();
     return Redirect::to('/building/' . $buildingid);
 }
开发者ID:axelardu,项目名称:festic-partner,代码行数:7,代码来源:DesignerController.php

示例14: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Room::create([]);
     }
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:7,代码来源:RoomsTableSeeder.php

示例15: getDelete

 public function getDelete($id)
 {
     $room = Room::find($id);
     $room->delete();
     Session::flash('message', 'The records are deleted successfully');
     return Redirect::to('rooms');
 }
开发者ID:andrinda,项目名称:myhotel,代码行数:7,代码来源:RoomsController.php


注:本文中的Room类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。