1 | <?php |
||
8 | class ContentBlock extends DataObject |
||
|
|||
9 | { |
||
10 | |||
11 | private static $casting = [ |
||
12 | 'RenderBlock' => 'HTMLText' |
||
13 | ]; |
||
14 | |||
15 | private static $db = [ |
||
16 | 'Sort' => 'Int', |
||
17 | 'Title' => 'Text', |
||
18 | ]; |
||
19 | |||
20 | private static $has_one = [ |
||
21 | 'ParentPage' => 'SiteTree', |
||
22 | ]; |
||
23 | |||
24 | private static $default_sort = 'Sort ASC'; |
||
25 | |||
26 | |||
27 | public function getCMSFields() |
||
34 | |||
35 | /** |
||
36 | * @return RequiredFields |
||
37 | */ |
||
38 | public function getCMSValidator() |
||
44 | |||
45 | public function onBeforeWrite() |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getTemplateName() |
||
63 | |||
64 | /** |
||
65 | * Renders the block for template |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public function RenderBlock() |
||
77 | |||
78 | /** |
||
79 | * Gets the block type for CMS display |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getBlockType() |
||
87 | |||
88 | } |
||
89 |
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.