original_string: 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);
  			}
  		}
  	}
code: 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);
  			}
  		}
  	}
code_tokens: 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 ) ; } } }
docstring: 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
docstring_tokens: change the room state if today is between period of Mesa for a given nombre_mesa_id or room object