]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
utility method to get reply profiles for a notice
authorEvan Prodromou <evan@status.net>
Sat, 16 Apr 2011 19:17:03 +0000 (15:17 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 16 Apr 2011 19:17:03 +0000 (15:17 -0400)
classes/Notice.php

index ada4d495d2b8af33940d3aaeac582b6fb9c519f9..bcd84501ec18fd2c2330a9b4b6c478fd7434d82c 100644 (file)
@@ -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.
      *