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