From: Evan Prodromou Date: Sat, 16 Apr 2011 19:17:03 +0000 (-0400) Subject: utility method to get reply profiles for a notice X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5135043b84255f713371285b756ddfad1b0eca5a;p=quix0rs-gnu-social.git utility method to get reply profiles for a notice --- 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. *