]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Status_network_tag.php
fixed typo http://status.net/open-source/issues/3289
[quix0rs-gnu-social.git] / classes / Status_network_tag.php
index 3398ac8c8496f6f6b52777c61fc28dcbb1327d1a..4a7c3b51ff15311a903f1ce4d303d80a32e4defa 100644 (file)
@@ -43,7 +43,6 @@ class Status_network_tag extends Safe_DataObject
         $this->_connect();
     }
 
-
     /* Static get */
     function staticGet($k,$v=null)
     {
@@ -112,8 +111,10 @@ class Status_network_tag extends Safe_DataObject
     function decache()
     {
         $key = 'status_network_tags:' . $this->site_id;
-        if (Status_network::$cache) {
-            Status_network::$cache->delete($key);
+        if (Status_network::$cache || Status_network::$cacheInitialized) {
+            // FIXME: this was causing errors, so I'm hiding them.
+            // I'm a big chicken and lazy.
+            @Status_network::$cache->delete($key);
         }
     }
 
@@ -130,4 +131,15 @@ class Status_network_tag extends Safe_DataObject
         $this->decache();
         return $ret;
     }
+
+    static function withTag($tag)
+    {
+        $snt = new Status_network_tag();
+
+        $snt->tag = $tag;
+
+        $snt->find();
+
+        return $snt;
+    }
 }