1 | <?php |
||
9 | class SearchLog extends DataObject |
||
|
|||
10 | { |
||
11 | private static $db = array( |
||
12 | 'Query' => 'Varchar(255)', |
||
13 | 'Title' => 'Varchar(255)', // title for breadcrumbs. any new facets added will be reflected here |
||
14 | 'Link' => 'Varchar(255)', |
||
15 | 'Filters' => 'Text', // json |
||
16 | 'NumResults' => 'Int', |
||
17 | ); |
||
18 | |||
19 | private static $has_one = array( |
||
20 | 'Member' => 'Member', |
||
21 | 'ParentSearch' => 'SearchLog', // used in constructing a search breadcrumb |
||
22 | ); |
||
23 | |||
24 | |||
25 | /** |
||
26 | * Generate the title if needed |
||
27 | */ |
||
28 | 5 | protected function onBeforeWrite() |
|
35 | |||
36 | |||
37 | /** |
||
38 | * @return ArrayList |
||
39 | */ |
||
40 | 5 | public function getBreadcrumbs() |
|
52 | |||
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getFiltersArray() |
||
61 | } |
||
62 |
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.