2021-08-25 04:29:26 +09:00
|
|
|
<?php
|
|
|
|
|
2021-10-05 01:00:58 +09:00
|
|
|
namespace Plugin\ActivityPub\Util\Response;
|
2021-08-25 04:29:26 +09:00
|
|
|
|
|
|
|
use App\Entity\Note;
|
|
|
|
use Exception;
|
2021-10-05 01:00:58 +09:00
|
|
|
use Plugin\ActivityPub\Util\Model\EntityToType\NoteToType;
|
2021-08-25 04:29:26 +09:00
|
|
|
|
|
|
|
abstract class NoteResponse
|
|
|
|
//class NoteResponse extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param Note $note
|
|
|
|
* @param int $status The response status code
|
|
|
|
*
|
|
|
|
* @throws Exception
|
|
|
|
*
|
|
|
|
* @return TypeResponse
|
|
|
|
*/
|
|
|
|
public static function handle(Note $note, int $status = 200): TypeResponse
|
|
|
|
// public function handle(Request $request, int $id): JsonResponse
|
|
|
|
{
|
|
|
|
// $note = DB::findOneBy('note', ['id' => $id]);
|
|
|
|
return new TypeResponse(data: NoteToType::translate($note), status: $status);
|
|
|
|
}
|
|
|
|
}
|