function show_restaurant($restaurantId) { $restaurantService = new RestaurantService(); $restaurant = $restaurantService->getRestaurantById($restaurantId); ?> <input id="rest_lat" value="<?php echo $restaurant->lat; ?> " type="hidden"/> <input id="rest_lon" value="<?php echo $restaurant->lon; ?> " type="hidden"/> <div><b>Restaurante <?php echo $restaurant->name; ?> </b></div> <div id="divMap" style="width:100%; height: 70px;"></div> <div><?php echo $restaurant->description; ?> <a href="<?php echo get_permalink($restaurantId); ?> " class="btn btn-xs btn-primary">Ver más</a> </div> <div class="row"> <div class="col-md-12"> <table class="table"> <tbody> <tr> <td><img src="<?php echo MECATO_PLUGIN_URL . 'inc/img/icons/address.png'; ?> " width="20" height="20" /><?php echo $restaurant->city->name . ' - ' . $restaurant->address; ?> </td> <td><img src="<?php echo MECATO_PLUGIN_URL . 'inc/img/icons/phone.png'; ?> " width="20" height="20" /><?php echo $restaurant->phone; ?> </td> </tr> </tbody> </table> </div> </div> <?php }
public function get_items($request) { $restaurantService = new RestaurantService(); $params = array('cityId' => $request->get_param('cityId')); if (strlen($request->get_param('menuType')) > 0) { $params['menuType'] = $request->get_param('menuType'); } //La consulta debe ser de más de tres parametros if (strlen($request->get_param('text')) > 3) { $params['text'] = $request->get_param('text'); } $restaurants = $restaurantService->getRestaurants($params); return $restaurants; }
private function updateFields($menu, $updateRestaurant) { if (isset($menu->price)) { update_post_meta($menu->id, 'wpcf-precio', $menu->price); } //update_post_meta($menu->id, 'wpcf-menuType',$menu->menuType); //Actualiza los ingredientes wp_set_post_terms($menu->id, $menu->topics, 'ingrediente'); wp_set_post_terms($menu->id, $menu->menuType, 'tipo-de-plato'); if ($updateRestaurant) { update_post_meta($menu->id, '_wpcf_belongs_restaurante_id', $menu->restaurantId); } //Actuliza el numero de platos que tiene el restaurante $restaurantService = new RestaurantService(); $restaurantService->updateNumMenuByType($menu->restaurantId); }
function show_view() { $post = get_post(); $restaurantService = new RestaurantService(); $restaurant = $restaurantService->getRestaurantById(); ?> <div id="divMainSection"> <div><?php echo $post->post_content; ?> </div> <input id="rest_lat" type="hidden" value="<?php echo $restaurant->lat; ?> "/> <input id="rest_lon" type="hidden" value="<?php echo $restaurant->lon; ?> "/> <?php $this->show_location($restaurant); $this->show_gallery($restaurant); $this->show_menu($post); $this->show_update_restaurant($post); ?> </div> <?php }