Permalink
Browse files

refactored to use Nette Db properly

  • Loading branch information...
1 parent e79ed80 commit 07196b0a4e3616dfe3e214937a4eb6c5635eca42 @juzna committed Mar 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/presenters/HomepagePresenter.php
@@ -55,7 +55,7 @@ public function addRepo(Form $frm) {
return;
}
- $this->db->exec("insert into repo", $info = array(
+ $repo = $this->db->table('repo')->insert(array(
'name' => $frm->values['name'],
'url' => $frm->values['url'],
'dir' => $match[1],
@@ -65,7 +65,7 @@ public function addRepo(Form $frm) {
// send mail
$msg = new \Nette\Mail\Message();
- $msg->addTo('juzna.cz@gmail.com')->setSubject('ApiGen - new repo added')->setBody(var_export($info, true));
+ $msg->addTo('juzna.cz@gmail.com')->setSubject('ApiGen - new repo added')->setBody(var_export($repo->toArray(), true));
$msg->send();
$this->flashMessage("Your project has been added. Downloading and generating documentation may take a minute...");

0 comments on commit 07196b0

Please sign in to comment.