1 | <?php |
||
23 | class HomePageBlock extends DataObject |
||
|
|||
24 | { |
||
25 | |||
26 | private static $db = [ |
||
27 | 'Title' => 'Varchar(64)', |
||
28 | 'Content' => 'HTMLText', |
||
29 | 'LinkText' => 'Varchar(64)', |
||
30 | 'ExternalLinkURL' => 'Varchar(255)', |
||
31 | 'IsActive' => 'Boolean', |
||
32 | 'SortOrder' => 'Int' |
||
33 | ]; |
||
34 | |||
35 | private static $has_one = [ |
||
36 | 'HomePage' => 'HomePage', |
||
37 | 'LinkToPage' => 'Page' |
||
38 | ]; |
||
39 | |||
40 | private static $singular_name = 'Home page block'; |
||
41 | |||
42 | private static $plural_name = 'Home page blocks'; |
||
43 | |||
44 | private static $summary_fields = [ |
||
45 | 'Title', 'IsActive' |
||
46 | ]; |
||
47 | |||
48 | private static $default_sort = 'SortOrder'; |
||
49 | |||
50 | /** |
||
51 | * for configuring fluent |
||
52 | * @var array |
||
53 | */ |
||
54 | private static $translate = [ |
||
55 | 'Title', |
||
56 | 'Content', |
||
57 | 'LinkText', |
||
58 | 'ExternalLinkURL' |
||
59 | ]; |
||
60 | |||
61 | public function getCMSFields() |
||
75 | |||
76 | public function getLink() |
||
86 | } |
||
87 |
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.