newUri might as well be put in Managed_DataObject
This commit is contained in:
parent
45bc192625
commit
37f2da03e1
@ -453,4 +453,16 @@ abstract class Managed_DataObject extends Memcached_DataObject
|
|||||||
{
|
{
|
||||||
// NOOP
|
// NOOP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function newUri(Profile $actor, Managed_DataObject $object, $created=null)
|
||||||
|
{
|
||||||
|
if (is_null($created)) {
|
||||||
|
$created = common_sql_now();
|
||||||
|
}
|
||||||
|
return TagURI::mint(strtolower(get_called_class()).':%d:%s:%d:%s',
|
||||||
|
$actor->getID(),
|
||||||
|
ActivityUtils::resolveUri($object->getObjectType(), true),
|
||||||
|
$object->getID(),
|
||||||
|
common_date_iso8601($created));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,18 +175,6 @@ class Deleted_notice extends Managed_DataObject
|
|||||||
$act->title = ActivityUtils::verbToTitle($act->verb);
|
$act->title = ActivityUtils::verbToTitle($act->verb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function newUri(Profile $actor, Managed_DataObject $object, $created=null)
|
|
||||||
{
|
|
||||||
if (is_null($created)) {
|
|
||||||
$created = common_sql_now();
|
|
||||||
}
|
|
||||||
return TagURI::mint(strtolower(get_called_class()).':%d:%s:%d:%s',
|
|
||||||
$actor->getID(),
|
|
||||||
ActivityUtils::resolveUri($object->getObjectType(), true),
|
|
||||||
$object->getID(),
|
|
||||||
common_date_iso8601($created));
|
|
||||||
}
|
|
||||||
|
|
||||||
static public function beforeSchemaUpdate()
|
static public function beforeSchemaUpdate()
|
||||||
{
|
{
|
||||||
$table = strtolower(get_called_class());
|
$table = strtolower(get_called_class());
|
||||||
|
@ -440,16 +440,4 @@ class Fave extends Managed_DataObject
|
|||||||
// We (should've in this case) created it ourselves, so we tag it ourselves
|
// We (should've in this case) created it ourselves, so we tag it ourselves
|
||||||
return self::newUri($this->getActor(), $this->getTarget(), $this->created);
|
return self::newUri($this->getActor(), $this->getTarget(), $this->created);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function newUri(Profile $actor, Managed_DataObject $target, $created=null)
|
|
||||||
{
|
|
||||||
if (is_null($created)) {
|
|
||||||
$created = common_sql_now();
|
|
||||||
}
|
|
||||||
return TagURI::mint(strtolower(get_called_class()).':%d:%s:%d:%s',
|
|
||||||
$actor->id,
|
|
||||||
ActivityUtils::resolveUri(self::getObjectType(), true),
|
|
||||||
$target->id,
|
|
||||||
common_date_iso8601($created));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user