diff options
author | emkael <emkael@tlen.pl> | 2016-02-26 14:59:53 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-02-26 14:59:53 +0100 |
commit | 0f69294121ee68616961af02bcfc0c7662cd3ba5 (patch) | |
tree | 2b290c247a48a5cf8c6f6234722f4fa4bacada23 /app/php/model/User.php | |
parent | b6ad16cbd2092d76d4fed03d37a77d29b5b38f00 (diff) |
* ActiveRecords model
Diffstat (limited to 'app/php/model/User.php')
-rw-r--r-- | app/php/model/User.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/php/model/User.php b/app/php/model/User.php new file mode 100644 index 0000000..8a33f67 --- /dev/null +++ b/app/php/model/User.php @@ -0,0 +1,33 @@ +<?php + +Prado::using('Application.model.Calendar'); + +class User extends TActiveRecord { + + const TABLE = 'users'; + + public $ID; + public $Login; + public $Password; + public $IsAdmin; + public $LastLogin; + + public static $COLUMN_MAPPING = [ + 'id' => 'ID', + 'login' => 'Login', + 'password' => 'Password', + 'is_admin' => 'IsAdmin', + 'last_login' => 'LastLogin' + ]; + + public static $RELATIONS = [ + 'Calendars' => [self::MANY_TO_MANY, 'Calendar', 'user_selections'] + ]; + + public static function finder($className=__CLASS__) { + return parent::finder($className); + } + +} + +?> |