BaseUser.class.php 12.4 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php

/**
 * BaseUser
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id
 * @property integer $manager_id
 * @property integer $city_id
 * @property string $username
 * @property string $fname
 * @property string $iname
 * @property string $oname
 * @property string $organization
 * @property string $city
 * @property string $inner_id
 * @property string $client_code
 * @property string $address
 * @property string $phone_number
 * @property string $email
 * @property string $limit_by_sum
 * @property string $current_discount
 * @property string $current_debt
 * @property string $orders_sum_last_month
 * @property string $orders_sum_current
 * @property string $salt
 * @property string $password
 * @property string $open_password
 * @property integer $manifest_version
 * @property string $cat_indx
 * @property string $cats_with_images
 * @property string $recovery_secret
 * @property boolean $is_active
 * @property boolean $is_super_admin
 * @property timestamp $last_login
 * @property User $Manager
 * @property Doctrine_Collection $User
 * 
 * @method integer             getId()                    Returns the current record's "id" value
 * @method integer             getManagerId()             Returns the current record's "manager_id" value
 * @method integer             getCityId()                Returns the current record's "city_id" value
 * @method string              getUsername()              Returns the current record's "username" value
 * @method string              getFname()                 Returns the current record's "fname" value
 * @method string              getIname()                 Returns the current record's "iname" value
 * @method string              getOname()                 Returns the current record's "oname" value
 * @method string              getOrganization()          Returns the current record's "organization" value
 * @method string              getCity()                  Returns the current record's "city" value
 * @method string              getInnerId()               Returns the current record's "inner_id" value
 * @method string              getClientCode()            Returns the current record's "client_code" value
 * @method string              getAddress()               Returns the current record's "address" value
 * @method string              getPhoneNumber()           Returns the current record's "phone_number" value
 * @method string              getEmail()                 Returns the current record's "email" value
 * @method string              getLimitBySum()            Returns the current record's "limit_by_sum" value
 * @method string              getCurrentDiscount()       Returns the current record's "current_discount" value
 * @method string              getCurrentDebt()           Returns the current record's "current_debt" value
 * @method string              getOrdersSumLastMonth()    Returns the current record's "orders_sum_last_month" value
 * @method string              getOrdersSumCurrent()      Returns the current record's "orders_sum_current" value
 * @method string              getSalt()                  Returns the current record's "salt" value
 * @method string              getPassword()              Returns the current record's "password" value
 * @method string              getOpenPassword()          Returns the current record's "open_password" value
 * @method integer             getManifestVersion()       Returns the current record's "manifest_version" value
 * @method string              getCatIndx()               Returns the current record's "cat_indx" value
 * @method string              getCatsWithImages()        Returns the current record's "cats_with_images" value
 * @method string              getRecoverySecret()        Returns the current record's "recovery_secret" value
 * @method boolean             getIsActive()              Returns the current record's "is_active" value
 * @method boolean             getIsSuperAdmin()          Returns the current record's "is_super_admin" value
 * @method timestamp           getLastLogin()             Returns the current record's "last_login" value
 * @method User                getManager()               Returns the current record's "Manager" value
 * @method Doctrine_Collection getUser()                  Returns the current record's "User" collection
 * @method User                setId()                    Sets the current record's "id" value
 * @method User                setManagerId()             Sets the current record's "manager_id" value
 * @method User                setCityId()                Sets the current record's "city_id" value
 * @method User                setUsername()              Sets the current record's "username" value
 * @method User                setFname()                 Sets the current record's "fname" value
 * @method User                setIname()                 Sets the current record's "iname" value
 * @method User                setOname()                 Sets the current record's "oname" value
 * @method User                setOrganization()          Sets the current record's "organization" value
 * @method User                setCity()                  Sets the current record's "city" value
 * @method User                setInnerId()               Sets the current record's "inner_id" value
 * @method User                setClientCode()            Sets the current record's "client_code" value
 * @method User                setAddress()               Sets the current record's "address" value
 * @method User                setPhoneNumber()           Sets the current record's "phone_number" value
 * @method User                setEmail()                 Sets the current record's "email" value
 * @method User                setLimitBySum()            Sets the current record's "limit_by_sum" value
 * @method User                setCurrentDiscount()       Sets the current record's "current_discount" value
 * @method User                setCurrentDebt()           Sets the current record's "current_debt" value
 * @method User                setOrdersSumLastMonth()    Sets the current record's "orders_sum_last_month" value
 * @method User                setOrdersSumCurrent()      Sets the current record's "orders_sum_current" value
 * @method User                setSalt()                  Sets the current record's "salt" value
 * @method User                setPassword()              Sets the current record's "password" value
 * @method User                setOpenPassword()          Sets the current record's "open_password" value
 * @method User                setManifestVersion()       Sets the current record's "manifest_version" value
 * @method User                setCatIndx()               Sets the current record's "cat_indx" value
 * @method User                setCatsWithImages()        Sets the current record's "cats_with_images" value
 * @method User                setRecoverySecret()        Sets the current record's "recovery_secret" value
 * @method User                setIsActive()              Sets the current record's "is_active" value
 * @method User                setIsSuperAdmin()          Sets the current record's "is_super_admin" value
 * @method User                setLastLogin()             Sets the current record's "last_login" value
 * @method User                setManager()               Sets the current record's "Manager" value
 * @method User                setUser()                  Sets the current record's "User" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseUser extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('user');
        $this->hasColumn('id', 'integer', null, array(
             'type' => 'integer',
             'primary' => true,
             'autoincrement' => true,
             ));
        $this->hasColumn('manager_id', 'integer', null, array(
             'type' => 'integer',
             ));
        $this->hasColumn('city_id', 'integer', 10, array(
             'type' => 'integer',
             'length' => 10,
             ));
        $this->hasColumn('username', 'string', 128, array(
             'type' => 'string',
             'notnull' => true,
             'unique' => true,
             'length' => 128,
             ));
        $this->hasColumn('fname', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('iname', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('oname', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('organization', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('city', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('inner_id', 'string', 50, array(
             'type' => 'string',
             'length' => 50,
             ));
        $this->hasColumn('client_code', 'string', 20, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 20,
             ));
        $this->hasColumn('address', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('phone_number', 'string', 100, array(
             'type' => 'string',
             'length' => 100,
             ));
        $this->hasColumn('email', 'string', 128, array(
             'type' => 'string',
             'notnull' => false,
             'length' => 128,
             ));
        $this->hasColumn('limit_by_sum', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('current_discount', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('current_debt', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('orders_sum_last_month', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('orders_sum_current', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('salt', 'string', 128, array(
             'type' => 'string',
             'length' => 128,
             ));
        $this->hasColumn('password', 'string', 128, array(
             'type' => 'string',
             'length' => 128,
             ));
        $this->hasColumn('open_password', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('manifest_version', 'integer', null, array(
             'type' => 'integer',
             'default' => 0,
             ));
        $this->hasColumn('cat_indx', 'string', 10000, array(
             'type' => 'string',
             'length' => 10000,
             ));
        $this->hasColumn('cats_with_images', 'string', 10000, array(
             'type' => 'string',
             'length' => 10000,
             ));
        $this->hasColumn('recovery_secret', 'string', 10000, array(
             'type' => 'string',
             'length' => 10000,
             ));
        $this->hasColumn('is_active', 'boolean', null, array(
             'type' => 'boolean',
             'default' => 0,
             ));
        $this->hasColumn('is_super_admin', 'boolean', null, array(
             'type' => 'boolean',
             'default' => false,
             ));
        $this->hasColumn('last_login', 'timestamp', null, array(
             'type' => 'timestamp',
             ));


        $this->index('name_idx', array(
             'fields' => 
             array(
              0 => 'username',
             ),
             'unique' => true,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasOne('User as Manager', array(
             'local' => 'manager_id',
             'foreign' => 'id'));

        $this->hasMany('User', array(
             'local' => 'id',
             'foreign' => 'manager_id'));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $this->actAs($timestampable0);
    }
}