No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
697996b
... +0 ...
67528e3
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
2 | 2 | ||
3 | 3 | namespace CWP\Search; |
|
4 | 4 | ||
5 | - | use SilverStripe\FullTextSearch\Search\Services\SearchableService; |
|
6 | 5 | use SilverStripe\ORM\PaginatedList; |
|
7 | 6 | use SilverStripe\View\ArrayData; |
|
8 | 7 | use SilverStripe\View\ViewableData; |
62 | 61 | public function __construct($terms = '', ArrayData $results = null) |
|
63 | 62 | { |
|
64 | 63 | $this->query = $terms; |
|
65 | - | $searchableService = SearchableService::singleton(); |
|
66 | 64 | if ($results) { |
|
67 | 65 | // Clean up the results. |
|
68 | 66 | $matches = $results->Matches; |
|
69 | 67 | foreach ($matches as $result) { |
|
70 | - | if (!$searchableService->isViewable($result)) { |
|
68 | + | if (!$result->canView()) { |
|
71 | 69 | $matches->remove($result); |
|
72 | 70 | } |
|
73 | 71 | } |
|
72 | + | ||
74 | 73 | $this->matches = $matches; |
|
75 | 74 | $this->suggestion = $results->SuggestionNice; |
|
76 | 75 | } |
Files | Complexity | Coverage |
---|---|---|
src | ø | 0.07% 22.58% |
Project Totals (12 files) | 107 | 22.58% |
67528e3
697996b