Example #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());
  }
Example #2
0
 public Restaurant update(EmenuContext context, Restaurant restaurant) {
   return restaurantDb.update(context, restaurant);
 }
Example #3
0
 public void delete(EmenuContext context, int id) {
   // TODO: Delete associated dishes&users.
   restaurantDb.delete(context, id);
 }
Example #4
0
 public List<Restaurant> getAll(EmenuContext context) {
   List<Restaurant> restaurants = restaurantDb.getAll(context);
   DataUtils.filterDeleted(restaurants);
   return restaurants;
 }