]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Status_network.php
Fixed layout when ad plugin is on for biz
[quix0rs-gnu-social.git] / classes / Status_network.php
index 445f8a5a3c5759e0c5a4b00ca1861ce85a9af5e3..4bda24b6a02d253aeb03ad2efdf65605da0ee65d 100644 (file)
@@ -39,9 +39,19 @@ class Status_network extends DB_DataObject
     public $logo;                            // varchar(255)
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
+    public $tags;                            // text
 
     /* Static get */
-    function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Status_network',$k,$v); }
+    function staticGet($k,$v=NULL) {
+        $i = DB_DataObject::staticGet('Status_network',$k,$v);
+
+        // Don't use local process cache; if we're fetching multiple
+        // times it's because we're reloading it in a long-running
+        // process; we need a fresh copy!
+        global $_DB_DATAOBJECT;
+        unset($_DB_DATAOBJECT['CACHE']['status_network']);
+        return $i;
+    }
 
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
@@ -245,4 +255,23 @@ class Status_network extends DB_DataObject
             return $this->nickname . '.' . self::$wildcard;
         }
     }
+
+    /**
+     * Return site meta-info tags as an array
+     * @return array of strings
+     */
+    function getTags()
+    {
+        return array_filter(explode("|", strval($this->tags)));
+    }
+
+    /**
+     * Check if this site record has a particular meta-info tag attached.
+     * @param string $tag
+     * @return bool
+     */
+    function hasTag($tag)
+    {
+        return in_array($tag, $this->getTags());
+    }
 }