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' => 'Search Alias (e.g. nz)', |
||
22 | 'Replace' => 'Actual Search Phrase (e.g. new zealand)', |
||
23 | ); |
||
24 | |||
25 | private static $field_labels = array( |
||
26 | 'Search' => 'Search Alias (e.g. nz)', |
||
27 | 'Replace' => 'Actual Search Phrase (e.g. new zealand)', |
||
28 | 'ReplaceWholePhrase' => 'Replace Whole Phrase Only' |
||
29 | ); |
||
30 | |||
31 | |||
32 | /** |
||
33 | * standard SS variable. |
||
34 | * |
||
35 | * @Var String |
||
36 | */ |
||
37 | private static $singular_name = 'Search Replacement'; |
||
38 | public function i18n_singular_name() |
||
42 | |||
43 | /** |
||
44 | * standard SS variable. |
||
45 | * |
||
46 | * @Var String |
||
47 | */ |
||
48 | private static $plural_name = 'Search Replacements'; |
||
49 | public function i18n_plural_name() |
||
53 | |||
54 | private static $separator = ','; |
||
55 | |||
56 | public function fieldLabels($includerelations = true) |
||
63 | |||
64 | public function onBeforeWrite() |
||
76 | |||
77 | /** |
||
78 | * standard SS method. |
||
79 | * |
||
80 | * @param Member $member |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function canCreate($member = null) |
||
99 | |||
100 | /** |
||
101 | * standard SS method. |
||
102 | * |
||
103 | * @param Member $member |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | public function canView($member = null) |
||
122 | |||
123 | /** |
||
124 | * standard SS method. |
||
125 | * |
||
126 | * @param Member $member |
||
127 | * |
||
128 | * @return bool |
||
129 | */ |
||
130 | public function canEdit($member = null) |
||
145 | |||
146 | /** |
||
147 | * standard SS method. |
||
148 | * |
||
149 | * @param Member $member |
||
150 | * |
||
151 | * @return bool |
||
152 | */ |
||
153 | public function canDelete($member = null) |
||
168 | |||
169 | /** |
||
170 | * link to edit the record. |
||
171 | * |
||
172 | * @param string | Null $action - e.g. edit |
||
173 | * |
||
174 | * @return string |
||
175 | */ |
||
176 | public function CMSEditLink($action = null) |
||
180 | } |
||
181 |