Drop timestamp cutoff parameter from User::getCurrentNotice() and Profile::getCurrentNotice().
It's not currently used, and won't be efficient when we update the notice.profile_id_idx index to optimize for our id-based sorting when pulling user post lists for profile pages, feeds etc.
This commit is contained in:
parent
66518df435
commit
ce92bc7143
@ -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)) {
|
||||
|
@ -132,13 +132,18 @@ class User extends Memcached_DataObject
|
||||
return !in_array($nickname, $blacklist);
|
||||
}
|
||||
|
||||
function getCurrentNotice($dt=null)
|
||||
/**
|
||||
* Get the most recent notice posted by this user, if any.
|
||||
*
|
||||
* @return mixed Notice or null
|
||||
*/
|
||||
function getCurrentNotice()
|
||||
{
|
||||
$profile = $this->getProfile();
|
||||
if (!$profile) {
|
||||
return null;
|
||||
}
|
||||
return $profile->getCurrentNotice($dt);
|
||||
return $profile->getCurrentNotice();
|
||||
}
|
||||
|
||||
function getCarrier()
|
||||
|
Loading…
Reference in New Issue
Block a user