getByPK (primary key) lookup for Managed_DataObject instances

This commit is contained in:
Mikael Nordfeldth
2015-06-04 22:17:40 +02:00
parent ca19a5cd6d
commit ebdd792b6f
4 changed files with 51 additions and 13 deletions

View File

@@ -313,16 +313,6 @@ class Notice extends Managed_DataObject
return $notice;
}
public static function getById($id)
{
$notice = new Notice();
$notice->id = $id;
if (!$notice->find(true)) {
throw new NoResultException($notice);
}
return $notice;
}
/**
* Extract #hashtags from this notice's content and save them to the database.
*/
@@ -2761,7 +2751,7 @@ class Notice extends Managed_DataObject
if (empty($this->reply_to)) {
throw new NoParentNoticeException($this);
}
return self::getById($this->reply_to);
return self::getByID($this->reply_to);
}
/**