1 | <?php |
||
3 | class SearchHistory extends DataObject |
||
|
|||
4 | { |
||
5 | private static $db = array( |
||
6 | 'Title' => 'Varchar(255)', |
||
7 | 'ProductCount' => 'Int', |
||
8 | 'GroupCount' => 'Int', |
||
9 | ); |
||
10 | |||
11 | private static $default_sort = '"Created" DESC'; |
||
12 | |||
13 | private static $searchable_fields = array( |
||
14 | 'Title' => 'PartialMatchFilter', |
||
15 | 'ProductCount' => 'GreaterThanOrEqualFilter', |
||
16 | 'GroupCount' => 'GreaterThanOrEqualFilter', |
||
17 | ); |
||
18 | |||
19 | private static $summary_fields = array( |
||
20 | 'Created' => 'When', |
||
21 | 'Title' => 'Keyword', |
||
22 | 'ProductCount' => 'Products Found', |
||
23 | 'GroupCount' => 'Categories Found', |
||
24 | ); |
||
25 | |||
26 | |||
27 | /** |
||
28 | * standard SS variable. |
||
29 | * |
||
30 | * @Var String |
||
31 | */ |
||
32 | private static $singular_name = 'Search History Entry'; |
||
33 | public function i18n_singular_name() |
||
37 | |||
38 | /** |
||
39 | * standard SS variable. |
||
40 | * |
||
41 | * @Var String |
||
42 | */ |
||
43 | private static $plural_name = 'Search History Entries'; |
||
44 | public function i18n_plural_name() |
||
48 | |||
49 | /** |
||
50 | * creates a new entry if you are not a shop admin. |
||
51 | * |
||
52 | * @param string $keywordString |
||
53 | * |
||
54 | * @return int |
||
55 | */ |
||
56 | public static function add_entry($keywordString, $productCount = 0, $groupCount = 0) |
||
70 | |||
71 | /** |
||
72 | * remove excessive spaces. |
||
73 | */ |
||
74 | public function onBeforeWrite() |
||
79 | |||
80 | /** |
||
81 | * standard SS method. |
||
82 | * |
||
83 | * @param Member $member |
||
84 | * |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function canCreate($member = null) |
||
91 | |||
92 | /** |
||
93 | * standard SS method. |
||
94 | * |
||
95 | * @param Member $member |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | public function canView($member = null) |
||
114 | |||
115 | /** |
||
116 | * standard SS method. |
||
117 | * |
||
118 | * @param Member $member |
||
119 | * |
||
120 | * @return bool |
||
121 | */ |
||
122 | public function canEdit($member = null) |
||
126 | |||
127 | /** |
||
128 | * standard SS method. |
||
129 | * |
||
130 | * @param Member $member |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | public function canDelete($member = null) |
||
138 | } |
||
139 |
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.