Commit ccb59ea 1 parent 2740499 commit ccb59ea Copy full SHA for ccb59ea
File tree 1 file changed +9
-17
lines changed
1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace FoF \FrontPage \Query ;
13
13
14
- use Flarum \Search \AbstractQueryState ;
14
+ use Flarum \Search \Database \ DatabaseSearchState ;
15
15
use Flarum \Search \Filter \FilterInterface ;
16
16
use Flarum \Search \SearchState ;
17
+ use Illuminate \Database \Eloquent \Builder ;
17
18
19
+ /**
20
+ * @implements FilterInterface<DatabaseSearchState>
21
+ */
18
22
class FrontFilter implements FilterInterface
19
23
{
20
- /**
21
- * @return string
22
- */
23
-
24
- /**
25
- * @return string
26
- */
27
24
public function getFilterKey (): string
28
25
{
29
26
return 'frontpage ' ;
30
27
}
31
28
32
- public function conditions (AbstractQueryState $ search , array $ matches , $ negate )
33
- {
34
- $ this ->constrain ($ search ->getQuery (), $ negate );
35
- }
36
-
37
- public function filter (SearchState $ state , array |string $ value , bool $ negate ): void
29
+ public function filter (SearchState $ state , string |array $ value , bool $ negate ): void
38
30
{
39
31
$ this ->constrain ($ state ->getQuery (), $ negate );
40
32
}
41
33
42
- protected function constrain (\ Illuminate \ Database \ Eloquent \ Builder $ query , bool $ actor ): void
34
+ protected function constrain (Builder $ query , bool $ negate ): void
43
35
{
44
- $ query ->where ('frontpage ' , !$ actor );
36
+ $ query ->where ('frontpage ' , ! $ negate );
45
37
}
46
- }
38
+ }
You can’t perform that action at this time.
0 commit comments