Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Alerte |
---|
5 | * |
---|
6 | * This class has been auto-generated by the Doctrine ORM Framework |
---|
7 | * |
---|
8 | * @package cpc |
---|
9 | * @subpackage model |
---|
10 | * @author Your name here |
---|
11 | * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ |
---|
12 | */ |
---|
13 | class Alerte extends BaseAlerte |
---|
14 | { |
---|
15 | public function getEmail() { |
---|
16 | if ($this->citoyen_id) { |
---|
17 | return $this->getCitoyen()->email; |
---|
18 | } |
---|
19 | return $this->_get('email'); |
---|
20 | } |
---|
21 | |
---|
22 | public function generateVerif() { |
---|
23 | $v = md5(rand(1, 999999999999)); |
---|
24 | $this->_set('verif', $v); |
---|
25 | return $v; |
---|
26 | } |
---|
27 | public function getTitre() { |
---|
28 | if (!$this->_get('titre')) |
---|
29 | return "Recherche correspondant aux mots clés « ".$this->query." »"; |
---|
30 | return $this->_get('titre'); |
---|
31 | } |
---|
32 | |
---|
33 | public function save(Doctrine_Connection $c = null) { |
---|
34 | if (!$this->last_mail) |
---|
35 | $this->last_mail = date('Y-m-d H:i:s'); |
---|
36 | if (!$this->verif) |
---|
37 | $this->generateVerif(); |
---|
38 | if ($this->citoyen_id) |
---|
39 | $this->confirmed = 1; |
---|
40 | $this->query_md5 = md5($this->query.$this->filter); |
---|
41 | return parent::save($c); |
---|
42 | } |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.