return $this->_locations->find_by('id', $location_id); } private function _update_appointment_locations($service_id, $old_location_id, $location_id) { global $wpdb, $appointments; if ($old_location_id == $location_id) { return false; } $res = $wpdb->update($appointments->app_table, array('location' => $location_id), array('location' => $old_location_id, 'service' => $service_id), '%s', '%s'); } private function _get_service_location_markup($service_id, $fallback = '', $rich_content = true) { $location = $this->_service_to_location($service_id); if (!$location) { return $fallback; } return $this->_get_location_markup($location, $rich_content); } private function _get_location_markup($location, $rich_content = true) { return '<div class="app-service_description-location" id="app-service_description-location-' . $location->get_id() . '">' . apply_filters('app-locations-location_output', $location->get_display_markup($rich_content), $service_id, $location) . '</div>'; } private function _map_description_post_to_service_id($post_id) { global $appointments, $wpdb; $sql = $wpdb->prepare("SELECT ID FROM {$appointments->services_table} WHERE page=%d", $post_id); return $wpdb->get_var($sql); } } App_Locations_ServiceLocations::serve();