1 | <?php |
||
7 | class GridFieldDropdownAddNewButton extends GridFieldAddNewButton |
||
8 | implements GridField_ActionProvider { |
||
9 | |||
10 | /** |
||
11 | * Class names |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $modelClasses = null; |
||
16 | |||
17 | /** |
||
18 | * This is because this doesn't extend Object |
||
19 | * |
||
20 | */ |
||
21 | public static function create($baseClass, $classes, $targetFragment = 'buttons-before-left') |
||
25 | |||
26 | /** |
||
27 | * @param string $baseClass |
||
28 | * @param array $classes Class or list of classes to create. |
||
29 | * @param string $targetFragment The fragment to render the button into |
||
30 | */ |
||
31 | public function __construct($baseClass, $classes, $targetFragment = 'buttons-before-left') |
||
47 | |||
48 | /** |
||
49 | * Specify the classes to create |
||
50 | * |
||
51 | * @param array $classes |
||
52 | */ |
||
53 | public function setClasses($classes) |
||
57 | |||
58 | /** |
||
59 | * Get the classes of the objects to create |
||
60 | * |
||
61 | * @return array |
||
62 | */ |
||
63 | public function getClasses() |
||
67 | |||
68 | /** |
||
69 | * Abstract method to fill out. Gets the HTML for this component |
||
70 | * @param $gridField GridField |
||
71 | */ |
||
72 | public function getHTMLFragments($gridField) |
||
128 | |||
129 | /** |
||
130 | * Provide actions to this component. |
||
131 | * |
||
132 | * @param GridField $gridField |
||
133 | * @return array |
||
134 | **/ |
||
135 | public function getActions($gridField) { |
||
138 | |||
139 | /** |
||
140 | * Handles the add action |
||
141 | * |
||
142 | * @param GridField $gridField |
||
143 | * @param string $actionName |
||
144 | * @param mixed $arguments |
||
145 | * @param array $data |
||
146 | **/ |
||
147 | public function handleAction(GridField $gridField, $actionName, $arguments, $data) |
||
180 | |||
181 | /** |
||
182 | * Validates that a class is okay for creation |
||
183 | * |
||
184 | * @param string |
||
185 | * @return bool |
||
186 | */ |
||
187 | public function isValidClass($class) |
||
195 | } |
||
196 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.