function __construct($booking_data = false) { global $wpdb; //add extra cleaning function in case we're wanting to convert a normal EM_Booking object if (is_object($booking_data) && get_class($booking_data) == 'EM_Booking') { $booking_data = $booking_data->to_array(); } //load like a normal booking parent::__construct($booking_data); }