From 5135043b84255f713371285b756ddfad1b0eca5a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 16 Apr 2011 15:17:03 -0400 Subject: [PATCH] utility method to get reply profiles for a notice --- classes/Notice.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/classes/Notice.php b/classes/Notice.php index ada4d495d2..bcd84501ec 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1309,6 +1309,26 @@ class Notice extends Memcached_DataObject return $ids; } + /** + * Pull the complete list of @-reply targets for this notice. + * + * @return array of Profiles + */ + function getReplyProfiles() + { + $ids = $this->getReplies(); + $profiles = array(); + + foreach ($ids as $id) { + $profile = Profile::staticGet('id', $id); + if (!empty($profile)) { + $profiles[] = $profile; + } + } + + return $profiles; + } + /** * Send e-mail notifications to local @-reply targets. * -- 2.39.5