From f8fa9a942fefffb99b8559bc483393464b9ac21e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 23 Nov 2008 22:49:52 -0500 Subject: Make replies to @# darcs-hash:20081124034952-84dde-e059f0800780de879ffa922e5ce379682a4f275a.gz --- classes/Profile_tag.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'classes') diff --git a/classes/Profile_tag.php b/classes/Profile_tag.php index 9943ebfa0..dde19aea2 100644 --- a/classes/Profile_tag.php +++ b/classes/Profile_tag.php @@ -83,4 +83,19 @@ class Profile_tag extends Memcached_DataObject return true; } + + # Return profiles with a given tag + static function getTagged($tagger, $tag) { + $profile = new Profile(); + $profile->query('SELECT profile.* ' . + 'FROM profile JOIN profile_tag ' . + 'ON profile.id = profile_tag.tagged ' . + 'WHERE profile_tag.tagger = ' . $tagger . ' ' . + 'AND profile_tag.tag = "' . $tag . '" '); + $tagged = array(); + while ($profile->fetch()) { + $tagged[] = clone($profile); + } + return $tagged; + } } -- cgit v1.2.3-54-g00ecf