diff options
author | Evan Prodromou <evan@status.net> | 2010-02-25 08:44:15 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-25 08:44:15 -0500 |
commit | e6858d7203bd36923f6251968bede6f4b271bf84 (patch) | |
tree | daf24ce51064058af226eb8e296476a3f9155473 /classes/Local_group.php | |
parent | ddc3671b6aeb0b543d261251a1740a53469684c3 (diff) |
modify group actions so they use Local_group to look up by nickname
Diffstat (limited to 'classes/Local_group.php')
-rw-r--r-- | classes/Local_group.php | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/classes/Local_group.php b/classes/Local_group.php index 02663048f..42312ec63 100644 --- a/classes/Local_group.php +++ b/classes/Local_group.php @@ -2,9 +2,8 @@ /** * Table Definition for local_group */ -require_once 'classes/Memcached_DataObject.php'; -class Local_group extends Memcached_DataObject +class Local_group extends Memcached_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -16,8 +15,32 @@ class Local_group extends Memcached_DataObject public $modified; // timestamp not_null default_CURRENT_TIMESTAMP /* Static get */ - function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Local_group',$k,$v); } + 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; + } } |