diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-26 09:35:28 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-26 09:35:28 -0800 |
commit | 8dfc8f1635940b096e7f4025e3aef0ca4f909eb2 (patch) | |
tree | 9fce4aa765d56496031698f219da2f0f82b33e80 /classes/Local_group.php | |
parent | 8914b69d5055c1bc7d0604ee338ffdaf6b0a8606 (diff) | |
parent | b331e971b055386a126aaec27d661f26ba3b813c (diff) |
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'classes/Local_group.php')
-rw-r--r-- | classes/Local_group.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/classes/Local_group.php b/classes/Local_group.php new file mode 100644 index 000000000..42312ec63 --- /dev/null +++ b/classes/Local_group.php @@ -0,0 +1,46 @@ +<?php +/** + * Table Definition for local_group + */ + +class Local_group extends Memcached_DataObject +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__table = 'local_group'; // table name + public $group_id; // int(4) primary_key not_null + public $nickname; // varchar(64) unique_key + public $created; // datetime not_null default_0000-00-00%2000%3A00%3A00 + public $modified; // timestamp not_null default_CURRENT_TIMESTAMP + + /* Static get */ + function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Local_group',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE + + function sequenceKey() + { + return array(false, false, false); + } + + function setNickname($nickname) + { + $this->decache(); + $qry = 'UPDATE local_group set nickname = "'.$nickname.'" where group_id = ' . $this->group_id; + + $result = $this->query($qry); + + if ($result) { + $this->nickname = $nickname; + $this->fixupTimestamps(); + $this->encache(); + } else { + common_log_db_error($local, 'UPDATE', __FILE__); + throw new ServerException(_('Could not update local group.')); + } + + return $result; + } +} |