root/trunk/lib/model/Interest.php

Revision 88, 0.9 kB (checked in by fabien, 2 years ago)

updated to symfony 1.0 beta 1

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 require_once 'lib/model/om/BaseInterest.php';
4
5
6 /**
7  * Skeleton subclass for representing a row from the 'ask_interest' table.
8  *
9  *
10  *
11  * You should add additional methods to this class to meet the
12  * application requirements.  This class will only be generated as
13  * long as it does not already exist in the output directory.
14  *
15  * @package model
16  */   
17 class Interest extends BaseInterest
18 {
19   public function save($con = null)
20   {
21     $con = Propel::getConnection();
22     try
23     {
24       $con->begin();
25
26       $ret = parent::save();
27
28       // update interested_users in question table
29       $question = $this->getQuestion();
30       $interested_users = $question->getInterestedUsers();
31       $question->setInterestedUsers($interested_users + 1);
32       $question->save();
33
34       $con->commit();
35
36       return $ret;
37     }
38     catch (Exception $e)
39     {
40       $con->rollback();
41       throw $e;
42     }
43   }
44 }
45
46 ?>
Note: See TracBrowser for help on using the browser.