]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Local_group.php
Don't update stored URLs just because we have a filename
[quix0rs-gnu-social.git] / classes / Local_group.php
index 44d8957838f0823772bc59abb4ce5875b2fe6ec4..1cebd4c40c3a777bbb31b95ab8dcf3230485c0f2 100644 (file)
@@ -14,9 +14,6 @@ class Local_group extends Managed_DataObject
     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
 
@@ -41,10 +38,27 @@ class Local_group extends Managed_DataObject
         );
     }
 
+    public function getProfile()
+    {
+        return $this->getGroup()->getProfile();
+    }
+
+    public function getGroup()
+    {
+        $group = new User_group();
+        $group->id = $this->group_id;
+        $group->find(true);
+        if (!$group instanceof User_group) {
+            common_log(LOG_ERR, 'User_group does not exist for Local_group: '.$this->group_id);
+            throw new NoSuchGroupException(array('id' => $this->group_id));
+        }
+        return $group;
+    }
+
     function setNickname($nickname)
     {
         $this->decache();
-        $qry = 'UPDATE local_group set nickname = "'.$nickname.'" where group_id = ' . $this->group_id;
+        $qry = 'UPDATE local_group set nickname = "'.$this->escape($nickname).'" where group_id = ' . $this->group_id;
 
         $result = $this->query($qry);