コード例 #1
0
ファイル: NewsPresenter.php プロジェクト: klajmajk/futro
 public function actionCreate()
 {
     $this->inputData['user'] = $this->user->getId();
     if (!empty($this->inputData['date_end'])) {
         $this->encapsulateInDateTime($this->inputData['date_end']);
     }
     if (!empty($this->inputData['send_mail'])) {
         unset($this->inputData['send_mail']);
         $this->sendMail();
     }
     parent::actionCreate();
 }
コード例 #2
0
ファイル: UserPresenter.php プロジェクト: klajmajk/futro
 public function actionCreateCredit($id)
 {
     $this->inputData['user'] = $id;
     try {
         $this->db->beginTransaction();
         $updateQuery = 'UPDATE `user` SET `balance` = `balance` + ? WHERE `id` = ?';
         $this->db->query($updateQuery, $this->inputData['amount'], $id);
         parent::actionCreate();
     } catch (\Nette\Application\AbortException $ex) {
         $this->db->commit();
         throw $ex;
     } catch (\Exception $ex) {
         $this->db->rollback();
     }
 }
コード例 #3
0
ファイル: KegPresenter.php プロジェクト: klajmajk/futro
 public function actionCreateConsumption($id)
 {
     parent::actionCreate();
 }