1 | <?php |
||
12 | class ContentImageBlock extends BaseBlock { |
||
|
|||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | * @config |
||
17 | */ |
||
18 | private static $db = [ |
||
19 | 'Template' => 'Enum(array( |
||
20 | "BottomImageTopContent", |
||
21 | "TopImageBottomContent", |
||
22 | |||
23 | "LeftImageRightContentWrap", |
||
24 | "LeftBiggerImageRightContentWrap", |
||
25 | "RightImageLeftContentWrap", |
||
26 | "RightBiggerImageLeftContentWrap", |
||
27 | |||
28 | "LeftImageRightContent", |
||
29 | "LeftBiggerImageRightContent", |
||
30 | "RightImageLeftContent", |
||
31 | "RightBiggerImageLeftContent", |
||
32 | |||
33 | "BottomImageListTopContent", |
||
34 | "TopImageListBottomContent", |
||
35 | |||
36 | "FullWidthImageLeftContent" |
||
37 | ), "LeftBiggerImageRightContent")', |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | * @config |
||
43 | */ |
||
44 | private static $many_many = [ |
||
45 | 'Images' => 'Image', |
||
46 | ]; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | * @config |
||
51 | */ |
||
52 | private static $many_many_extraFields = [ |
||
53 | 'Images' => ['SortOrder' => 'Int'], |
||
54 | ]; |
||
55 | |||
56 | /** |
||
57 | * If the singular name is set in a private static $singular_name, it cannot be changed using the translation files |
||
58 | * for some reason. Fix it by defining a method that handles the translation. |
||
59 | * @return string |
||
60 | */ |
||
61 | public function singular_name() { |
||
64 | |||
65 | /** |
||
66 | * If the plural name is set in a private static $plural_name, it cannot be changed using the translation files |
||
67 | * for some reason. Fix it by defining a method that handles the translation. |
||
68 | * @return string |
||
69 | */ |
||
70 | public function plural_name() { |
||
73 | |||
74 | /** |
||
75 | * Get template types as lowercase and dashed string. |
||
76 | * |
||
77 | * @param string $currentType |
||
78 | * |
||
79 | * @return array|string |
||
80 | */ |
||
81 | public function getTemplateTypes($currentType = null) { |
||
94 | |||
95 | /** |
||
96 | * Get current template type as lowercase and dashed string. |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getTemplateType() { |
||
103 | |||
104 | /** |
||
105 | * @return \FieldList |
||
106 | */ |
||
107 | public function getCMSFields() { |
||
128 | |||
129 | /** |
||
130 | * @param bool $includeRelations |
||
131 | * |
||
132 | * @return array |
||
133 | */ |
||
134 | public function fieldLabels($includeRelations = true) { |
||
154 | |||
155 | /** |
||
156 | * @return array |
||
157 | */ |
||
158 | protected function getTemplateOptions() { |
||
175 | |||
176 | /** |
||
177 | * @return \HTMLText |
||
178 | */ |
||
179 | public function forTemplate() { |
||
188 | |||
189 | /** |
||
190 | * @return bool|\Image |
||
191 | */ |
||
192 | public function getFirstImage() { |
||
197 | |||
198 | } |
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.