コード例 #1
0
ファイル: BaseAdmin.php プロジェクト: pablozabo/Diarco
 static function deleteTestimonio($testimonioId)
 {
     $testimonio = BaseDao::getTestimonioById($testimonioId);
     $result = new Result();
     try {
         $transaction = GenericDao::beginTransaction();
         $testimonio->deleted = true;
         BaseDao::updateTestimonio($testimonio, $transaction);
         $transaction->commit();
     } catch (\Exception $ex) {
         $transaction->rollBack();
         $result->hasErrors = true;
         $result->messages = array($ex->getMessage());
     }
     $response = new Response($result, NULL);
     return json_encode($response);
 }