}
/**
+ * Creates activities array from URI id, user id
+ *
* @param int $uriId Uri-ID of the item
- * @return Array
+ * @param int $uid User id
+ * @param string $type Type of returned activities, can be 'json' or 'xml', default: json
+ *
+ * @return array Array of found activities
* @throws HTTPException\InternalServerErrorException
*/
- public function createFromUriId(int $uriId, int $uid, $type = 'json'): array
+ public function createFromUriId(int $uriId, int $uid, string $type = 'json'): array
{
$activities = [
'like' => [],
case Activity::LIKE:
$activities['like'][] = $user;
break;
+
case Activity::DISLIKE:
$activities['dislike'][] = $user;
break;
+
case Activity::ATTEND:
$activities['attendyes'][] = $user;
break;
+
case Activity::ATTENDNO:
$activities['attendno'][] = $user;
break;
+
case Activity::ATTENDMAYBE:
$activities['attendmaybe'][] = $user;
break;
+
case Activity::ANNOUNCE:
$activities['announce'][] = $user;
break;
+
default:
+ $this->logger->warning('Unsupported verb in parent item:', ['parent_item' => $parent_item]);
break;
}
}
$xml_activities = [];
foreach ($activities as $k => $v) {
// change xml element from "like" to "friendica:like"
- $xml_activities["friendica:".$k] = $v;
+ $xml_activities['friendica:' . $k] = $v;
// add user data into xml output
$k_user = 0;
foreach ($v as $user) {