Firesphere /
silverstripe-search
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * class GridFieldExtension|Firesphere\SearchBackend\Extensions\GridFieldExtension Add colours to the GridField |
||||
| 4 | * |
||||
| 5 | * @package Firesphere\Search\Backend |
||||
| 6 | * @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo |
||||
| 7 | * @copyright Copyright (c) 2018 - now() Firesphere & Sheepy |
||||
| 8 | */ |
||||
| 9 | |||||
| 10 | namespace Firesphere\SearchBackend\Extensions; |
||||
| 11 | |||||
| 12 | use Firesphere\SearchBackend\Models\SearchLog; |
||||
| 13 | use SilverStripe\Core\Extension; |
||||
| 14 | use SilverStripe\Forms\GridField\GridField; |
||||
| 15 | use SilverStripe\ORM\DataObject; |
||||
| 16 | use SilverStripe\View\ViewableData; |
||||
| 17 | |||||
| 18 | /** |
||||
| 19 | * Class GridFieldExtension |
||||
| 20 | * Dirty hack to get the alert/warning/info classes in to the gridfield |
||||
| 21 | * |
||||
| 22 | * @property GridField|GridFieldExtension $owner |
||||
| 23 | */ |
||||
| 24 | class GridFieldExtension extends Extension |
||||
| 25 | { |
||||
| 26 | /** |
||||
| 27 | * Add the visibility classes to the GridField |
||||
| 28 | * |
||||
| 29 | * @param array $classes |
||||
| 30 | * @param int $total |
||||
| 31 | * @param string $index |
||||
| 32 | * @param DataObject $record |
||||
| 33 | */ |
||||
| 34 | public function updateNewRowClasses(array &$classes, int $total, string $index, ViewableData $record) |
||||
|
0 ignored issues
–
show
The parameter
$total is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 35 | { |
||||
| 36 | if ($record instanceof SearchLog) { |
||||
| 37 | $classes[] = $record->getExtraClass(); |
||||
| 38 | } |
||||
| 39 | } |
||||
| 40 | } |
||||
| 41 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.