Using some Managed_DataObject::getByPK calls for consistency

This commit is contained in:
Mikael Nordfeldth
2015-10-10 21:40:02 +02:00
parent 37f2da03e1
commit 18f07a48e8
2 changed files with 9 additions and 13 deletions

View File

@@ -99,12 +99,7 @@ class Deleted_notice extends Managed_DataObject
static public function fromStored(Notice $stored)
{
$class = get_called_class();
$object = new $class;
$object->uri = $stored->getUri(); // Lookup by delete activity's URI! (that's what is _stored_ in our db!)
if (!$object->find(true)) {
throw new NoResultException($object);
}
return $object;
return self::getByPK(array('uri', $stored->getUri()));
}
// The one who deleted the notice, not the notice's author