summaryrefslogtreecommitdiff
path: root/app/php/model/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/php/model/User.php')
-rw-r--r--app/php/model/User.php33
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);
+ }
+
+}
+
+?>