$uri_id, 'activity' => $source, 'received' => DateTimeFormat::utcNow() ]; return DBA::insert('post-activity', $fields, Database::INSERT_IGNORE); } /** * Retrieves activity of the given uri-id * * @param int $uriId * * @return array */ public static function getByURIId(int $uriId): array { $activity = DBA::selectFirst('post-activity', [], ['uri-id' => $uriId]); return json_decode($activity['activity'] ?? '', true) ?? []; } /** * Checks if the given uridid has a stored activity * * @param integer $uriId * * @return boolean */ public static function exists(int $uriId): bool { return DBA::exists('post-activity', ['uri-id' => $uriId]); } }