X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FStatus_network.php;h=4bda24b6a02d253aeb03ad2efdf65605da0ee65d;hb=df2390a90f43e7493eef492960526df112efa9a4;hp=445f8a5a3c5759e0c5a4b00ca1861ce85a9af5e3;hpb=238998eca017a3ddd6cc0c01a75f8ace37661b5d;p=quix0rs-gnu-social.git diff --git a/classes/Status_network.php b/classes/Status_network.php index 445f8a5a3c..4bda24b6a0 100644 --- a/classes/Status_network.php +++ b/classes/Status_network.php @@ -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()); + } }