Exemplo n.º 1
0
 public static function update($ti, $anak = null)
 {
     $tindak = TindakLanjut::find($ti['other']['id']);
     if (isset($ti['other']['check'])) {
         $tindak = TindakLanjutDAO::exchangeArray($tindak, $ti);
         $tindak->update();
         if (!is_null($anak)) {
             $tindak->Anak()->attach($anak->id);
         }
     } else {
         if (!is_null($anak)) {
             $tindak->Anak()->detach($anak->id);
         }
     }
     return $tindak;
 }