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