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