summaryrefslogtreecommitdiff
path: root/classes/Local_group.php
diff options
context:
space:
mode:
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;
+ }
+}