Working on some RSVP code stuff

This commit is contained in:
Mikael Nordfeldth
2016-01-21 02:10:34 +01:00
parent 5999171c11
commit f74d2d555c
10 changed files with 126 additions and 66 deletions

View File

@@ -282,6 +282,11 @@ class Notice extends Managed_DataObject
return ActivityUtils::resolveUri($this->verb, $make_relative);
}
public function isVerb(array $verbs)
{
return ActivityUtils::compareVerbs($this->getVerb(), $verbs);
}
/*
* Get the original representation URL of this notice.
*
@@ -314,6 +319,15 @@ class Notice extends Managed_DataObject
return ActivityUtils::resolveUri($this->object_type, $canonical);
}
public function isObjectType(array $types)
{
try {
return ActivityUtils::compareTypes($this->getObjectType(), $types);
} catch (NoObjectTypeException $e) {
return false;
}
}
public static function getByUri($uri)
{
$notice = new Notice();