]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/Local_group.php
Merge branch 'blacklistplus' into testing
[quix0rs-gnu-social.git] / classes / Local_group.php
1 <?php
2 /**
3  * Table Definition for local_group
4  */
5
6 class Local_group extends Memcached_DataObject
7 {
8     ###START_AUTOCODE
9     /* the code below is auto generated do not remove the above tag */
10
11     public $__table = 'local_group';                     // table name
12     public $group_id;                        // int(4)  primary_key not_null
13     public $nickname;                        // varchar(64)  unique_key
14     public $created;                         // datetime   not_null default_0000-00-00%2000%3A00%3A00
15     public $modified;                        // timestamp   not_null default_CURRENT_TIMESTAMP
16
17     /* Static get */
18     function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Local_group',$k,$v); }
19
20     /* the code above is auto generated do not remove the tag below */
21     ###END_AUTOCODE
22
23     function sequenceKey()
24     {
25         return array(false, false, false);
26     }
27
28     function setNickname($nickname)
29     {
30         $this->decache();
31         $qry = 'UPDATE local_group set nickname = "'.$nickname.'" where group_id = ' . $this->group_id;
32
33         $result = $this->query($qry);
34
35         if ($result) {
36             $this->nickname = $nickname;
37             $this->fixupTimestamps();
38             $this->encache();
39         } else {
40             common_log_db_error($local, 'UPDATE', __FILE__);
41             throw new ServerException(_('Could not update local group.'));
42         }
43
44         return $result;
45     }
46 }