1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 12:40:40 +02:00

Replaced depreciated helper function with classfull function

This commit is contained in:
Matthew Kilgore
2020-07-25 21:08:49 -04:00
parent ba3071eaac
commit d1cf21dcd2

View File

@@ -10,12 +10,13 @@
namespace Flarum\Mentions\Listener; namespace Flarum\Mentions\Listener;
use Flarum\Event\ConfigurePostsQuery; use Flarum\Event\ConfigurePostsQuery;
use Illuminate\Support\Arr;
class AddFilterByMentions class AddFilterByMentions
{ {
public function handle(ConfigurePostsQuery $event) public function handle(ConfigurePostsQuery $event)
{ {
if ($mentionedId = array_get($event->filter, 'mentioned')) { if ($mentionedId = Arr::get($event->filter, 'mentioned')) {
$event->query->join('post_mentions_user', 'posts.id', '=', 'post_mentions_user.post_id') $event->query->join('post_mentions_user', 'posts.id', '=', 'post_mentions_user.post_id')
->where('post_mentions_user.mentions_user_id', '=', $mentionedId); ->where('post_mentions_user.mentions_user_id', '=', $mentionedId);
} }