Exemplo n.º 1
0
  public Restaurant add(EmenuContext context, Restaurant restaurant) {
    long now = System.currentTimeMillis();
    restaurant.setUpdateTime(now);
    restaurant.setCreatedTime(now);
    restaurantDb.add(context, restaurant);

    return restaurantDb.get(context, restaurant.getId());
  }
Exemplo n.º 2
0
 public Restaurant update(EmenuContext context, Restaurant restaurant) {
   return restaurantDb.update(context, restaurant);
 }
Exemplo n.º 3
0
 public void delete(EmenuContext context, int id) {
   // TODO: Delete associated dishes&users.
   restaurantDb.delete(context, id);
 }
Exemplo n.º 4
0
 public List<Restaurant> getAll(EmenuContext context) {
   List<Restaurant> restaurants = restaurantDb.getAll(context);
   DataUtils.filterDeleted(restaurants);
   return restaurants;
 }