<?php

class HouseDao {
    public static function updateStatus($status,$houseId){
        global $wpdb;
        $result = $wpdb->update(Config::TOSPUR_HOUSE_TABLE,array(
            'status' => $status
        ),array(
            'id' => $houseId
        ));
        if($wpdb->last_error)
            return $wpdb->last_error;
        return $result;
    }

    public static function checkHouseStatus($houseId){
        global $wpdb;
        $result = $wpdb->get_row(Config::TOSPUR_HOUSE_TABLE,array(
            'id' => $houseId
        ));
        if($wpdb->last_error)
            return $wpdb->last_error;
        return $result;
    }
}