]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/User.php
deny access to include files
[quix0rs-gnu-social.git] / classes / User.php
1 <?php
2 if (!defined('MICROBLOG')) { exit(1) }
3 /**
4  * Table Definition for user
5  */
6 require_once 'DB/DataObject.php';
7
8 class User extends DB_DataObject 
9 {
10     ###START_AUTOCODE
11     /* the code below is auto generated do not remove the above tag */
12
13     public $__table = 'user';                            // table name
14     public $id;                              // int(4)  primary_key not_null
15     public $password;                        // varchar(255)  
16     public $email;                           // varchar(255)  unique_key
17     public $created;                         // datetime()   not_null
18     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
19
20     /* Static get */
21     function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('User',$k,$v); }
22
23     /* the code above is auto generated do not remove the tag below */
24     ###END_AUTOCODE
25         
26         function getProfile() {
27                 return Profile::staticGet($this->$id);
28         }
29         
30         function isSubscribed($other) {
31                 assert(!is_null($other));
32                 $sub = DB_DataObject::factory('subscription');
33                 $sub->subscriber = $this->id;
34                 $sub->subscribed = $other->id;
35                 return $sub->find();
36         }
37 }