/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. */ public function loadModel() { if ($this->_model === null) { if (isset($_GET['id'])) { $this->_model = Kti::model()->findbyPk($_GET['id']); } if ($this->_model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } } return $this->_model; }
public function test_to_string() { $d = new Kti('someiban', 'somebic', 'someaccountNumber', 'sub', new Kik('DE', '72191600')); $this->assertEquals('someiban:somebic:someaccountNumber:sub:DE:72191600', (string) $d); $this->assertEquals('someiban:somebic:someaccountNumber:sub:DE:72191600', $d->toString()); }
protected function saveAll() { $messages = array(); $errors = array(); $kenaikanJabatan = $_SESSION['KenaikanJabatan']; if ($kenaikanJabatan->save()) { $messages[] = 'kenaikan jabatan saved'; } else { $errors[] = 'kenaikan jabatan not saved'; } $kti = new Kti(); $kti->kenaikan_jabatan_id = $kenaikanJabatan->id; if ($kti->save()) { $messages[] = 'kti saved'; } else { $errors[] = 'kti not saved'; } foreach ($_SESSION['KtiItem'] as $item) { $item->kti_id = $kti->id; if ($item->save()) { $messages[] = "kti item #{$item->id} saved"; } else { $errors[] = 'kti item not saved'; } } $dupak = $_SESSION['Dupak']; $dupak->kenaikan_jabatan_id = $kenaikanJabatan->id; if ($dupak->save()) { $messages[] = 'dupak saved'; } else { $errors[] = 'dupak not saved'; } foreach ($_SESSION['Nilai'] as $nilai) { $nilai->dupak_id = $dupak->id; if ($nilai->save()) { $messages[] = "nilai #{$nilai->id} saved!"; } else { $errors[] = 'nilai not saved!'; } } foreach ($_SESSION['CatatanKetuaPenilai'] as $catatan) { $catatan->dupak_id = $dupak->id; if ($catatan->save()) { $messages[] = "catatan Ketua tim penilai #{$catatan->id} saved!"; } else { $errors[] = 'catatan Ketua tim penilai not saved!'; } } foreach ($_SESSION['CatatanTimPenilai'] as $catatan) { $catatan->dupak_id = $dupak->id; if ($catatan->save()) { $messages[] = "catatan tim penilai #{$catatan->id} saved!"; } else { $errors[] = 'catatan tim penilai not saved!'; } } foreach ($_SESSION['CatatanPengusul'] as $catatan) { $catatan->dupak_id = $dupak->id; if ($catatan->save()) { $messages[] = "catatan Pejabat Pengusul #{$catatan->id} saved!"; } else { $errors[] = 'catatan Pejabat Pengusul tim penilai not saved!'; } } foreach ($_SESSION['Lampiran'] as $lampiran) { $lampiran->dupak_id = $dupak->id; if ($lampiran->save()) { $messages[] = "Lampiran #{$lampiran->id} saved!"; } else { $errors[] = "Lampiran not saved!"; } } foreach ($_SESSION['Penilai'] as $penilai) { $penilai->dupak_id = $dupak->id; if ($penilai->save()) { $messages[] = "Penilai #{$penilai->id} saved!"; } else { $errors[] = "Penilai not saved!"; } } unset($_SESSION['KenaikanJabatan']); unset($_SESSION['Kti']); unset($_SESSION['KtiItem']); unset($_SESSION['Dupak']); unset($_SESSION['Nilai']); unset($_SESSION['CatatanKetuaPenilai']); unset($_SESSION['CatatanTimPenilai']); unset($_SESSION['CatatanPengusul']); unset($_SESSION['Lampiran']); unset($_SESSION['Penilai']); $_SESSION['Errors'] = $errors; $_SESSION['Messages'] = $messages; return !empty($errors); }