summaryrefslogtreecommitdiff
path: root/classes/Local_group.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-02 15:16:48 -0800
committerBrion Vibber <brion@pobox.com>2010-03-02 15:16:48 -0800
commit8e06b932af93b8fbd66610c948bdde4fafd4f300 (patch)
tree07b772b280e6f23761c0111d953b3c2f5b8d2120 /classes/Local_group.php
parent453ad6a9964fe572f0f35821e3f78c6a77c57c49 (diff)
parentddf3614c843bcd8d9ecfd0850ac9a8cefae6dbba (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes/Local_group.php')
-rw-r--r--classes/Local_group.php46
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;
+ }
+}