1 | <?php |
||
13 | class GridFieldQueuedJobExecute implements GridField_ColumnProvider, GridField_ActionProvider |
||
14 | { |
||
15 | |||
16 | protected $action = 'execute'; |
||
17 | |||
18 | /** |
||
19 | * CSS icon class names for each action (see silverstripe-admin fonts) |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $icons = [ |
||
24 | 'execute' => 'font-icon-block-media', |
||
25 | 'pause' => 'font-icon-cancel-circled', |
||
26 | 'resume' => 'font-icon-sync', |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * Call back to see if the record's action icon should be shown. |
||
31 | * |
||
32 | * @var callable |
||
33 | */ |
||
34 | protected $viewCheck; |
||
35 | |||
36 | /** |
||
37 | * @param string $action |
||
38 | * @param callable $check |
||
39 | */ |
||
40 | public function __construct($action = 'execute', $check = null) |
||
51 | |||
52 | /** |
||
53 | * Add a column 'Delete' |
||
54 | * |
||
55 | * @param GridField $gridField |
||
56 | * @param array $columns |
||
57 | */ |
||
58 | public function augmentColumns($gridField, &$columns) |
||
64 | |||
65 | /** |
||
66 | * Return any special attributes that will be used for FormField::createTag() |
||
67 | * |
||
68 | * @param GridField $gridField |
||
69 | * @param DataObject $record |
||
70 | * @param string $columnName |
||
71 | * @return array |
||
72 | */ |
||
73 | public function getColumnAttributes($gridField, $record, $columnName) |
||
77 | |||
78 | /** |
||
79 | * Add the title |
||
80 | * |
||
81 | * @param GridField $gridField |
||
82 | * @param string $columnName |
||
83 | * @return array |
||
84 | */ |
||
85 | public function getColumnMetadata($gridField, $columnName) |
||
91 | |||
92 | /** |
||
93 | * Which columns are handled by this component |
||
94 | * |
||
95 | * @param GridField $gridField |
||
96 | * @return array |
||
97 | */ |
||
98 | public function getColumnsHandled($gridField) |
||
102 | |||
103 | /** |
||
104 | * Which GridField actions are this component handling |
||
105 | * |
||
106 | * @param GridField $gridField |
||
107 | * @return array |
||
108 | */ |
||
109 | public function getActions($gridField) |
||
113 | |||
114 | /** |
||
115 | * @param GridField $gridField |
||
116 | * @param DataObject $record |
||
117 | * @param string $columnName |
||
118 | * @return string|void - the HTML for the column |
||
119 | */ |
||
120 | public function getColumnContent($gridField, $record, $columnName) |
||
151 | |||
152 | /** |
||
153 | * Handle the actions and apply any changes to the GridField |
||
154 | * |
||
155 | * @param GridField $gridField |
||
156 | * @param string $actionName |
||
157 | * @param mixed $arguments |
||
158 | * @param array $data - form data |
||
159 | * @return void |
||
160 | */ |
||
161 | public function handleAction(GridField $gridField, $actionName, $arguments, $data) |
||
173 | } |
||
174 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: