public static function update($ps, $anak = null)
 {
     $psiko = KondisiPsikososial::find($ps['id']);
     $psiko = KondisiPsikososialDAO::exchangeArray($psiko, $ps);
     if (!is_null($anak)) {
         $psiko->Anak()->associate($anak);
     }
     $psiko->update();
     return $psiko;
 }
 public function delete($id)
 {
     //notifikasi
     FormKA4DisposisiHelper::deleteNotif($id);
     $fm = Form::find($id);
     $anakId = 64;
     $anak = Anak::find($anakId);
     $forms = $anak->form;
     //delete semua form yang berkaitan
     foreach ($forms as $form) {
         if ($form->nama == "ka4" || $form->nama == "ka5" || $form->nama == "ka6" || $form->nama == "ka7") {
             FormDAO::delete($form->id);
         }
     }
     //delete data pendampingan
     $pendamping = $anak->Pendampingan()->get();
     foreach ($pendamping as $pd) {
         PendampinganDAO::delete($pd->id);
     }
     $gf = $anak->GambaranFisik()->get();
     foreach ($gf as $val) {
         GambaranFisikDAO::delete($val->id);
     }
     $kp = $anak->KondisiPsikososial()->get();
     foreach ($kp as $val) {
         KondisiPsikososialDAO::delete($val->id);
     }
     $im = $anak->IdentifikasiMasalah()->get();
     foreach ($im as $val) {
         IdentifikasiMasalahDAO::delete($val->id);
     }
     $kel = $anak->Keluarga()->get();
     foreach ($kel as $val) {
         KeluargaDAO::delete($val->id);
     }
     if ($fm) {
         Session::flash('message', "Form with {$id} has been deleted!");
     } else {
         Session::flash('message', "Error, Form with {$id} not found!");
     }
     return Redirect::to('/dash/formka4');
 }