summaryrefslogtreecommitdiff
path: root/app/php/model/User.php
blob: d43118317c2ab7014a9b255f359100e6ead4acdf (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
<?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 $IsAdmin;
    public $Timezone;
    public $LastLogin;

    public static $COLUMN_MAPPING = [
        'id' => 'ID',
        'login' => 'Login',
        'password' => 'Password',
        'is_admin' => 'IsAdmin',
        'timezone' => 'Timezone',
        'last_login' => 'LastLogin'
    ];

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

    public static function finder($className=__CLASS__) {
        return parent::finder($className);
    }

}

?>