Mesa/Model/Mesa.php
public function changeRoomStateIfTodayInPeriod($room, $checkin, $checkout) {
		if (!is_array($room) && (is_string($room) || is_int($room))) {
			$room = $this->Room->findById($room);
		}
		$today = date('Y-m-d');
		if ($this->hasRoomMesaInDate($room, $today)) {
			return $this->Room->changeRoomState($room, 2); // 2 = Ocupada
		} else {
			if ($room['Room']['room_state_id'] != 4) {
				return $this->Room->changeRoomState($room, 1);
			}
		}
	}
public function changeRoomStateIfTodayInPeriod($room, $checkin, $checkout) {
		if (!is_array($room) && (is_string($room) || is_int($room))) {
			$room = $this->Room->findById($room);
		}
		$today = date('Y-m-d');
		if ($this->hasRoomMesaInDate($room, $today)) {
			return $this->Room->changeRoomState($room, 2); // 2 = Ocupada
		} else {
			if ($room['Room']['room_state_id'] != 4) {
				return $this->Room->changeRoomState($room, 1);
			}
		}
	}
public function changeRoomStateIfTodayInPeriod ( $ room , $ checkin , $ checkout ) { if ( ! is_array ( $ room ) && ( is_string ( $ room ) || is_int ( $ room ) ) ) { $ room = $ this -> Room -> findById ( $ room ) ; } $ today = date ( 'Y-m-d' ) ; if ( $ this -> hasRoomMesaInDate ( $ room , $ today ) ) { return $ this -> Room -> changeRoomState ( $ room , 2 ) ; // 2 = Ocupada } else { if ( $ room [ 'Room' ] [ 'room_state_id' ] != 4 ) { return $ this -> Room -> changeRoomState ( $ room , 1 ) ; } } }
change the room state if today is between period of Mesa for a given nombre_mesa_id or room object
@param int|array $room
@param string $checkin
@param string $checkout
@return void
change the room state if today is between period of Mesa for a given nombre_mesa_id or room object