1 : <?php
2 :
3 1 : Doctrine_Manager::getInstance()->bindComponent('PromoCodes', 'doctrine');
4 :
5 :
6 :
7 :
8 :
9 :
10 :
11 :
12 :
13 :
14 :
15 :
16 :
17 :
18 :
19 :
20 :
21 :
22 : abstract class BasePromoCodes extends Doctrine_Record
23 1 : {
24 : public function setTableDefinition()
25 : {
26 1 : $this->setTableName('promo_codes');
27 1 : $this->hasColumn('id', 'integer', 4, array(
28 1 : 'type' => 'integer',
29 1 : 'fixed' => 0,
30 1 : 'unsigned' => true,
31 1 : 'primary' => true,
32 1 : 'autoincrement' => false,
33 1 : 'length' => '4',
34 1 : ));
35 1 : $this->hasColumn('code', 'string', 45, array(
36 1 : 'type' => 'string',
37 1 : 'fixed' => 0,
38 1 : 'unsigned' => false,
39 1 : 'primary' => false,
40 1 : 'notnull' => true,
41 1 : 'autoincrement' => false,
42 1 : 'length' => '45',
43 1 : ));
44 1 : $this->hasColumn('action', 'string', 45, array(
45 1 : 'type' => 'string',
46 1 : 'fixed' => 0,
47 1 : 'unsigned' => false,
48 1 : 'primary' => false,
49 1 : 'notnull' => true,
50 1 : 'autoincrement' => false,
51 1 : 'length' => '45',
52 1 : ));
53 1 : $this->hasColumn('desc', 'string', null, array(
54 1 : 'type' => 'string',
55 1 : 'fixed' => 0,
56 1 : 'unsigned' => false,
57 1 : 'primary' => false,
58 1 : 'notnull' => true,
59 1 : 'autoincrement' => false,
60 1 : 'length' => '',
61 1 : ));
62 1 : $this->hasColumn('isactive', 'integer', 1, array(
63 1 : 'type' => 'integer',
64 1 : 'fixed' => 0,
65 1 : 'unsigned' => false,
66 1 : 'primary' => false,
67 1 : 'notnull' => true,
68 1 : 'autoincrement' => false,
69 1 : 'length' => '1',
70 1 : ));
71 1 : }
72 :
73 : public function setUp()
74 : {
75 1 : parent::setUp();
76 1 : $this->hasMany('PromoRegistered', array(
77 1 : 'local' => 'id',
78 1 : 'foreign' => 'promo_id'));
79 1 : }
|