Flarum\Core\Search\Discussion\Gambit\HiddenGambit::conditions PHP Method

conditions() protected method

protected conditions ( AbstractSearch $search, array $matches, $negate )
$search Flarum\Core\Search\AbstractSearch
$matches array
    protected function conditions(AbstractSearch $search, array $matches, $negate)
    {
        if (!$search instanceof DiscussionSearch) {
            throw new LogicException('This gambit can only be applied on a DiscussionSearch');
        }
        $search->getQuery()->where(function ($query) use($negate) {
            if ($negate) {
                $query->whereNull('hide_time')->where('comments_count', '>', 0);
            } else {
                $query->whereNotNull('hide_time')->orWhere('comments_count', 0);
            }
        });
    }
HiddenGambit