Beispiel #1
0
 public void update(String id, String title, MenuVisibility visibility, String link, int order) {
   Menu menu = this.read(id);
   if (StringUtils.hasText(title)) menu.setTitle(title);
   if (StringUtils.hasText(link)) menu.setTitle(link);
   if (visibility != null) menu.setVisibility(visibility);
   if (order > 0) menu.setOrder(order);
   this.menuRepository.save(menu);
 }
Beispiel #2
0
 public void create(String id, String title, MenuVisibility visibility, String link, int order) {
   Menu menu = new Menu();
   menu.setId(id);
   menu.setTitle(title);
   menu.setVisibility(visibility);
   menu.setLink(link);
   if (order > 0) {
     menu.setOrder(order);
   }
   this.menuRepository.insert(menu);
 }