| 1 | <?php |
||
| 3 | class DMSGridFieldAddNewButton extends GridFieldAddNewButton implements GridField_HTMLProvider |
||
|
|
|||
| 4 | { |
||
| 5 | /** |
||
| 6 | * The page ID that the document should be attached to. Used in the GridField for Documents in a Page. |
||
| 7 | * |
||
| 8 | * @var int |
||
| 9 | */ |
||
| 10 | protected $pageId; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Overriding the parent method to change the template that the DMS add button will be rendered with |
||
| 14 | * |
||
| 15 | * @param GridField $gridField |
||
| 16 | * @return array |
||
| 17 | */ |
||
| 18 | public function getHTMLFragments($gridField) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Set the page ID that this document should be attached to |
||
| 49 | * |
||
| 50 | * @param int $id |
||
| 51 | * @return $this |
||
| 52 | */ |
||
| 53 | public function setPageId($id) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Get the page ID that this document should be attached to |
||
| 61 | * |
||
| 62 | * @return int |
||
| 63 | */ |
||
| 64 | public function getPageId() |
||
| 68 | } |
||
| 69 |
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.