summaryrefslogtreecommitdiff
path: root/app/frontend/model/User.php
blob: 57f49b939129f6f04d55808c482f528bc325863c (plain)
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
<?php

Prado::using('Application.db.ActiveRecord');
Prado::using('Application.model.Calendar');

class User extends ActiveRecord {

    const TABLE = 'users';

    public $ID;
    public $Login;
    public $Password;
    public $EMail;
    public $ActivationHash;
    public $IsActive;
    public $ActivationDate;
    public $LastLogin;
    public $IsAdmin;
    public $Timezone;
    public $Language;
    public $GroupedView;

    public static $COLUMN_MAPPING = [
        'id' => 'ID',
        'login' => 'Login',
        'password' => 'Password',
        'e_mail' => 'EMail',
        'activation_hash' => 'ActivationHash',
        'is_active' => 'IsActive',
        'activation_date' => 'ActivationDate',
        'last_login' => 'LastLogin',
        'is_admin' => 'IsAdmin',
        'timezone' => 'Timezone',
        'language' => 'Language',
        'grouped_view' => 'GroupedView',
    ];

    public static $RELATIONS = [
        'Calendars' => [self::MANY_TO_MANY, 'Calendar', 'user_selections'],
        'AuthKeys' => [self::HAS_MANY, 'UserAuthKey', '_user']
    ];

}

?>