1 | <?php |
||
13 | class GridFieldMergeAction implements GridField_ColumnProvider, GridField_ActionProvider |
||
14 | { |
||
15 | use Injectable; |
||
16 | |||
17 | /** |
||
18 | * List of records to show in the MergeAction column. |
||
19 | * |
||
20 | * @var array|SS_List |
||
21 | */ |
||
22 | protected $records; |
||
23 | |||
24 | /** |
||
25 | * Type of parent DataObject (i.e BlogTag, BlogCategory). |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $parentType; |
||
30 | |||
31 | /** |
||
32 | * Relationship method to reference parent (i.e BlogTags). |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $parentMethod; |
||
37 | |||
38 | /** |
||
39 | * Relationship method to reference child (i.e BlogPosts). |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $childMethod; |
||
44 | |||
45 | /** |
||
46 | * @param array|SS_List $records |
||
47 | * @param string $parentType |
||
48 | * @param string $parentMethod |
||
49 | * @param string $childMethod |
||
50 | */ |
||
51 | public function __construct($records, $parentType, $parentMethod, $childMethod) |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function augmentColumns($gridField, &$columns) |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function getColumnsHandled($gridField) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function getColumnContent($gridField, $record, $columnName) |
||
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | public function getColumnAttributes($gridField, $record, $columnName) |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function getColumnMetadata($gridField, $columnName) |
||
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | public function getActions($gridField) |
||
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | public function handleAction(GridField $gridField, $actionName, $arguments, $data) |
||
165 | } |
||
166 |