summaryrefslogtreecommitdiff
path: root/classes/Status_network.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-27 22:05:32 -0500
committerEvan Prodromou <evan@status.net>2010-01-27 22:05:32 -0500
commit5e1a9ad04d4e10ee44881a26ea72c9a80f748188 (patch)
tree78b7f4287d00a2ff32cf6adf82c6289a5d3b6b95 /classes/Status_network.php
parent817f01c3b18ec626701de2a1402562eeb87eee6d (diff)
parentee4ea3f3e1eb64df2dd3ba677f5201f8787482a8 (diff)
Merge branch 'testing'
Conflicts: theme/base/css/display.css
Diffstat (limited to 'classes/Status_network.php')
-rw-r--r--classes/Status_network.php31
1 files changed, 30 insertions, 1 deletions
diff --git a/classes/Status_network.php b/classes/Status_network.php
index 445f8a5a3..4bda24b6a 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());
+ }
}