Пример #1
0
 public static Scenario edit(
     Long scenarioId,
     String newName,
     Boolean newIsPublic,
     Date newExpirationDate,
     Boolean isAccepted) {
   Scenario scenario = find.ref(scenarioId);
   if (newName != null && !newName.equals(scenario.name)) {
     scenario.name = newName;
   }
   if (newIsPublic != null && newIsPublic != scenario.isPublic) {
     scenario.isPublic = newIsPublic;
   }
   if (newExpirationDate != null && !newExpirationDate.equals(scenario.expirationDate)) {
     scenario.expirationDate = newExpirationDate;
   }
   scenario.isAccepted = isAccepted;
   scenario.editedBy = null;
   scenario.save();
   return scenario;
 }
Пример #2
0
 public static IdentityDocType get(Long id) {
   return find.ref(id);
 }
Пример #3
0
 public static void delete(Long id) {
   find.ref(id).delete();
 }
Пример #4
0
 public static Doctor get(Long id) {
   return find.ref(id);
 }