summaryrefslogtreecommitdiff
path: root/classes/Profile.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-13 06:36:25 -0600
committerEvan Prodromou <evan@status.net>2010-03-13 06:36:25 -0600
commitc1e96cbdefa66e66815c421378b9452d7c8d5548 (patch)
treea08e80d705d08ffb33233991bf80e7c19867552a /classes/Profile.php
parenta2cc26ba8a21aa3614ebfc4a77c0bec9ffb2655d (diff)
parent9e9ab23e1f936eb62014d8f7b0051f0314ae482c (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'classes/Profile.php')
-rw-r--r--classes/Profile.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 0322c9358..91f6e4692 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -147,14 +147,16 @@ class Profile extends Memcached_DataObject
return ($this->fullname) ? $this->fullname : $this->nickname;
}
- # Get latest notice on or before date; default now
- function getCurrentNotice($dt=null)
+ /**
+ * Get the most recent notice posted by this user, if any.
+ *
+ * @return mixed Notice or null
+ */
+ function getCurrentNotice()
{
$notice = new Notice();
$notice->profile_id = $this->id;
- if ($dt) {
- $notice->whereAdd('created < "' . $dt . '"');
- }
+ // @fixme change this to sort on notice.id only when indexes are updated
$notice->orderBy('created DESC, notice.id DESC');
$notice->limit(1);
if ($notice->find(true)) {