1 | <?php |
||
3 | class NutriHolder extends DataObject |
||
|
|||
4 | { |
||
5 | private static $singular_name = 'Nutritional Information Profile'; |
||
6 | public function i18n_singular_name() |
||
10 | |||
11 | private static $plural_name = 'Nutritional Information Profiles'; |
||
12 | public function i18n_plural_name() |
||
16 | |||
17 | private static $db = array( |
||
18 | 'ProfileName' => 'Varchar(50)', |
||
19 | 'ServingCount' => 'Int', |
||
20 | 'Container' => 'Varchar(10)', |
||
21 | 'ServingSize' => 'Varchar(15)', |
||
22 | 'AdditionalInfo' => 'Varchar(100)', |
||
23 | 'HidePerServeColumn' => 'Boolean', |
||
24 | 'HidePer100gColumn' => 'Boolean', |
||
25 | 'HidePerDVColumn' => 'Boolean' |
||
26 | ); |
||
27 | |||
28 | |||
29 | private static $has_many = array( |
||
30 | 'NutriRows' => 'NutriRow', |
||
31 | 'Products' => 'ProductGroup', |
||
32 | 'ProductVariations' => 'ProductVariation' |
||
33 | ); |
||
34 | |||
35 | /** |
||
36 | * @inherited |
||
37 | */ |
||
38 | private static $casting = array( |
||
39 | 'Title' => "Varchar", |
||
40 | 'Per100Unit' => "Varchar" |
||
41 | ); |
||
42 | |||
43 | /** |
||
44 | * Returns the unit for the 'Per 100' column of nutritional information. It tries |
||
45 | * to get the unit from the ServingSize field, and if no match returns 'g' |
||
46 | * @return String |
||
47 | */ |
||
48 | public function Per100Unit() |
||
52 | |||
53 | public function getPer100Unit() |
||
63 | |||
64 | /** |
||
65 | * @return String |
||
66 | */ |
||
67 | public function Title() |
||
83 | |||
84 | private static $summary_fields = array( |
||
85 | 'Title' => 'Title', |
||
86 | ); |
||
87 | |||
88 | private static $searchable_fields = array( |
||
89 | 'ProfileName' => 'PartialMatchFilter', |
||
90 | 'ServingCount' => 'ExactMatchFilter', |
||
91 | 'Container' => 'PartialMatchFilter', |
||
92 | 'ServingSize' => 'ExactMatchFilter', |
||
93 | 'AdditionalInfo' => 'PartialMatchFilter', |
||
94 | 'AdditionalInfo' => 'PartialMatchFilter' |
||
95 | ); |
||
96 | |||
97 | public function getCMSFields() |
||
163 | |||
164 | /** |
||
165 | * @return DataList |
||
166 | */ |
||
167 | public function ShownNutriRows() |
||
172 | |||
173 | /** |
||
174 | * @return DataList |
||
175 | */ |
||
176 | public function NumberOfTableColums() |
||
190 | } |
||
191 |
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.