]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Status_network.php
Merge commit 'refs/merge-requests/43' of https://gitorious.org/social/mainline into...
[quix0rs-gnu-social.git] / classes / Status_network.php
index b7a7e1c0a7de0ae09a7a8cabaede07c0041fff2f..ffbf9d5a3c0efd0c9c708739aff459a9702bc117 100644 (file)
@@ -42,7 +42,8 @@ class Status_network extends Safe_DataObject
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
     /* Static get */
-    function staticGet($k,$v=NULL) {
+    static function getKV($k,$v=NULL) {
+        // TODO: This must probably be turned into a non-static call
         $i = DB_DataObject::staticGet('Status_network',$k,$v);
 
         // Don't use local process cache; if we're fetching multiple
@@ -69,7 +70,7 @@ class Status_network extends Safe_DataObject
      * @param string $dbname
      * @param array $servers memcached servers to use for caching config info
      */
-    static function setupDB($dbhost, $dbuser, $dbpass, $dbname, $servers)
+    static function setupDB($dbhost, $dbuser, $dbpass, $dbname, array $servers)
     {
         global $config;
 
@@ -112,13 +113,13 @@ class Status_network extends Safe_DataObject
     }
 
     static function cacheKey($k, $v) {
-        return 'statusnet:' . self::$base . ':status_network:'.$k.':'.$v;
+        return 'gnusocial:' . self::$base . ':status_network:'.$k.':'.$v;
     }
 
     static function memGet($k, $v)
     {
         if (!self::$cache) {
-            return self::staticGet($k, $v);
+            return self::getKV($k, $v);
         }
 
         $ck = self::cacheKey($k, $v);
@@ -126,7 +127,7 @@ class Status_network extends Safe_DataObject
         $sn = self::$cache->get($ck);
 
         if (empty($sn)) {
-            $sn = self::staticGet($k, $v);
+            $sn = self::getKV($k, $v);
             if (!empty($sn)) {
                 self::$cache->set($ck, clone($sn));
             }
@@ -146,12 +147,12 @@ class Status_network extends Safe_DataObject
         }
     }
 
-    function update($orig=null)
+    function update($dataObject=false)
     {
-        if (is_object($orig)) {
-            $orig->decache(); # might be different keys
+        if (is_object($dataObject)) {
+            $dataObject->decache(); # might be different keys
         }
-        return parent::update($orig);
+        return parent::update($dataObject);
     }
 
     /**
@@ -182,10 +183,10 @@ class Status_network extends Safe_DataObject
         return $result;
     }
 
-    function delete()
+    function delete($useWhere=false)
     {
         $this->decache(); # while we still have the values!
-        return parent::delete();
+        return parent::delete($useWhere);
     }
 
     /**
@@ -317,14 +318,7 @@ class Status_network extends Safe_DataObject
      */
     function getTags()
     {
-        $result = Status_network_tag::getTags($this->site_id);
-
-        // XXX : for backwards compatibility
-        if (empty($result)) {
-            return explode('|', $this->tags);
-        }
-
-        return $result;
+        return Status_network_tag::getTags($this->site_id);
     }
 
     /**
@@ -332,7 +326,7 @@ class Status_network extends Safe_DataObject
      * @param array tags
      * @fixme only add/remove differentials
      */
-    function setTags($tags)
+    function setTags(array $tags)
     {
         $this->clearTags();
         foreach ($tags as $tag) {