1 | <?php |
||
7 | class SearchReplacement extends DataObject implements EditableEcommerceObject |
||
|
|||
8 | { |
||
9 | private static $db = array( |
||
10 | 'Search' => 'Varchar(255)', |
||
11 | 'Replace' => 'Varchar(255)', |
||
12 | 'ReplaceWholePhrase' => 'Boolean' |
||
13 | ); |
||
14 | |||
15 | private static $indexes = array( |
||
16 | 'SearchIndex' => 'unique("Search")', |
||
17 | 'Replace' => true |
||
18 | ); |
||
19 | |||
20 | private static $summary_fields = array( |
||
21 | 'Search' => 'Aliases (e.g. Biike)', |
||
22 | 'Replace' => 'Proper name (e.g. Bike)', |
||
23 | ); |
||
24 | |||
25 | private static $field_labels = array( |
||
26 | 'Search' => 'Aliases (e.g. Biike)', |
||
27 | 'Replace' => 'Proper Name (e.g. Bike)', |
||
28 | 'ReplaceWholePhrase' => 'Replace Whole Phrase' |
||
29 | ); |
||
30 | |||
31 | |||
32 | |||
33 | /** |
||
34 | * standard SS variable. |
||
35 | * |
||
36 | * @Var String |
||
37 | */ |
||
38 | private static $singular_name = 'Search Replacement'; |
||
39 | public function i18n_singular_name() |
||
43 | |||
44 | /** |
||
45 | * standard SS variable. |
||
46 | * |
||
47 | * @Var String |
||
48 | */ |
||
49 | private static $plural_name = 'Search Replacements'; |
||
50 | public function i18n_plural_name() |
||
54 | |||
55 | private static $separator = ','; |
||
56 | |||
57 | public function fieldLabels($includerelations = true) |
||
64 | |||
65 | public function onBeforeWrite() |
||
77 | |||
78 | /** |
||
79 | * standard SS method. |
||
80 | * |
||
81 | * @param Member $member |
||
82 | * |
||
83 | * @return bool |
||
84 | */ |
||
85 | public function canCreate($member = null) |
||
100 | |||
101 | /** |
||
102 | * standard SS method. |
||
103 | * |
||
104 | * @param Member $member |
||
105 | * |
||
106 | * @return bool |
||
107 | */ |
||
108 | public function canView($member = null) |
||
123 | |||
124 | /** |
||
125 | * standard SS method. |
||
126 | * |
||
127 | * @param Member $member |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function canEdit($member = null) |
||
146 | |||
147 | /** |
||
148 | * standard SS method. |
||
149 | * |
||
150 | * @param Member $member |
||
151 | * |
||
152 | * @return bool |
||
153 | */ |
||
154 | public function canDelete($member = null) |
||
169 | |||
170 | /** |
||
171 | * link to edit the record. |
||
172 | * |
||
173 | * @param string | Null $action - e.g. edit |
||
174 | * |
||
175 | * @return string |
||
176 | */ |
||
177 | public function CMSEditLink($action = null) |
||
181 | } |
||
182 |
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.