mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update StatusService, add getDirectMessage method
This commit is contained in:
parent
fbaed93eda
commit
f88b3a2fb9
1 changed files with 14 additions and 0 deletions
|
@ -47,6 +47,20 @@ class StatusService {
|
|||
return $res;
|
||||
}
|
||||
|
||||
public static function getDirectMessage($id)
|
||||
{
|
||||
$status = Status::whereScope('direct')->find($id);
|
||||
|
||||
if(!$status) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$fractal = new Fractal\Manager();
|
||||
$fractal->setSerializer(new ArraySerializer());
|
||||
$resource = new Fractal\Resource\Item($status, new StatusTransformer());
|
||||
return $fractal->createData($resource)->toArray();
|
||||
}
|
||||
|
||||
public static function del($id)
|
||||
{
|
||||
$status = self::get($id);
|
||||
|
|
Loading…
Reference in a new issue