1 | <?php |
||
5 | class CountryPrice_Translation extends DataObject |
||
|
|||
6 | { |
||
7 | private static $db = array( |
||
8 | 'Title' => 'Varchar(200)', |
||
9 | 'Content' => 'HTMLText', |
||
10 | 'WithoutTranslation' => 'Boolean' |
||
11 | ); |
||
12 | |||
13 | private static $field_labels = array( |
||
14 | 'Title' => 'Page Title', |
||
15 | 'Content' => 'Page Content', |
||
16 | 'EcommerceCountryID' => 'Country', |
||
17 | 'WithoutTranslation' => 'Without Translation' |
||
18 | ); |
||
19 | |||
20 | private static $has_one = array( |
||
21 | 'EcommerceCountry' => 'EcommerceCountry', |
||
22 | 'Parent' => 'SiteTree' |
||
23 | ); |
||
24 | |||
25 | private static $summary_fields = array( |
||
26 | 'EcommerceCountry.Name' => 'Country', |
||
27 | 'Title' => 'Title', |
||
28 | 'WithoutTranslation.Nice' => 'Price Difference Only' |
||
29 | ); |
||
30 | |||
31 | private static $casting = array( |
||
32 | 'Link' => 'Varchar' |
||
33 | ); |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private static $locale_get_parameter = 'ecomlocale'; |
||
39 | |||
40 | /** |
||
41 | * Standard SS variable. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | private static $singular_name = 'Translation'; |
||
46 | public function i18n_singular_name() |
||
50 | |||
51 | /** |
||
52 | * Standard SS variable. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | private static $plural_name = 'Translations'; |
||
57 | public function i18n_plural_name() |
||
61 | |||
62 | /** |
||
63 | * CMS Fields |
||
64 | * @return FieldList |
||
65 | */ |
||
66 | public function getCMSFields() |
||
91 | |||
92 | public function canCreate($member = null) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | protected function validate() |
||
125 | |||
126 | /** |
||
127 | * 'PageField' => 'Title' |
||
128 | * 'TranslationField' => 'Title' |
||
129 | * |
||
130 | * @return ArrayList |
||
131 | */ |
||
132 | public function FieldsToReplace() |
||
154 | |||
155 | /** |
||
156 | * @return string |
||
157 | */ |
||
158 | function Link() |
||
162 | |||
163 | /** |
||
164 | * @return string |
||
165 | */ |
||
166 | function getLink() |
||
174 | } |
||
175 |
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.