53 public function tailAction(
Message $message, array $filter = [], array $order = [],
int $limit = 50): ?array
55 $reaction = $filter[
'reaction'] ??
null;
56 if ($reaction !==
null)
58 $reaction = mb_strtoupper($reaction);
59 $validateResult = Message\Reaction\ReactionItem::validateReaction($reaction);
60 if (!$validateResult->isSuccess())
62 $this->
addErrors($validateResult->getErrors());
69 'LAST_ID' => $filter[
'lastId'] ??
null,
71 'REACTION' => $reaction,
74 'ID' => $order[
'id'] ??
'DESC'
76 $reactionLimit = $this->
getLimit($limit);
78 $reactions = Message\Reaction\ReactionCollection::find($reactionFilter, $reactionOrder, $reactionLimit);
80 return (
new RestAdapter($reactions))->toRestFormat();