1 | <?php |
||
4 | class SecondHandArchive extends DataObject |
||
|
|||
5 | { |
||
6 | private static $db = array( |
||
7 | 'Title' => 'Varchar(255)', |
||
8 | 'InternalItemID' => 'Varchar(50)', |
||
9 | 'SerialNumber' => 'VarChar(50)', |
||
10 | 'DateItemWasBought' => 'Date', |
||
11 | 'DateItemWasSold' => 'Date', |
||
12 | 'ProductQuality' => 'ENUM("1, 2, 3, 4, 5, 6, 7, 8, 9, 10","10")', |
||
13 | 'SoldOnBehalf' => 'Boolean', |
||
14 | 'PurchasePrice' => 'Currency', |
||
15 | 'Price' => 'Currency', |
||
16 | 'SoldPrice' => 'Currency', |
||
17 | 'IncludesBoxOrCase' => 'ENUM("No, Box, Case, Both","No")', |
||
18 | 'OriginalManual' => 'Boolean', |
||
19 | 'PageID' => 'Int', |
||
20 | 'Description' => 'VarChar(255)', |
||
21 | 'SellersName' => 'VarChar(50)', |
||
22 | 'SellersPhone' => 'VarChar(30)', |
||
23 | 'SellersEmail' => 'VarChar(255)', |
||
24 | 'SellersAddress' => 'VarChar(255)', |
||
25 | 'SellersAddress2' => 'Varchar(255)', |
||
26 | 'SellersCity' => 'Varchar(100)', |
||
27 | 'SellersPostalCode' => 'Varchar(50)', |
||
28 | 'SellersRegionCode' => 'Varchar(100)', |
||
29 | 'SellersCountry' => 'Varchar(50)', |
||
30 | 'SellersIDType' => 'ENUM(",Drivers Licence, Firearms Licence, Passport","")', |
||
31 | 'SellersIDNumber' => 'Varchar(50)', |
||
32 | 'SellersDateOfBirth' => 'Date', |
||
33 | 'SellersIDExpiryDate' => 'Date', |
||
34 | 'SellersIDPhotocopy' => 'Boolean' |
||
35 | ); |
||
36 | |||
37 | public static function create_from_page($page) |
||
86 | |||
87 | |||
88 | /** |
||
89 | * stadard SS method |
||
90 | * @return Boolean |
||
91 | */ |
||
92 | public function canCreate($member = null) |
||
96 | |||
97 | |||
98 | /** |
||
99 | * stadard SS method |
||
100 | * @return Boolean |
||
101 | */ |
||
102 | public function canEdit($member = null) |
||
106 | |||
107 | /** |
||
108 | * stadard SS method |
||
109 | * @return Boolean |
||
110 | */ |
||
111 | public function canView($member = null) |
||
117 | |||
118 | /** |
||
119 | * stadard SS method |
||
120 | * @return Boolean |
||
121 | */ |
||
122 | public function canDelete($member = null) |
||
126 | |||
127 | |||
128 | private static $singular_name = 'Archived Second Hand Product'; |
||
129 | |||
130 | public function i18n_singular_name() |
||
134 | |||
135 | private static $plural_name = 'Archived Second Hand Products'; |
||
136 | |||
137 | public function i18n_plural_name() |
||
141 | |||
142 | private static $indexes = array( |
||
143 | 'PageID' => true, |
||
144 | 'InternalItemID' => true |
||
145 | ); |
||
146 | |||
147 | private static $default_sort = array( |
||
148 | 'LastEdited' => 'DESC' |
||
149 | ); |
||
150 | |||
151 | private static $summary_fields = array( |
||
152 | 'Title' => 'Title', |
||
153 | 'InternalItemID' => 'Code', |
||
154 | 'SerialNumber' => 'Serial', |
||
155 | 'DateItemWasBought' => 'Date Entered', |
||
156 | 'DateItemWasSold' => 'Date Sold', |
||
157 | 'ProductQuality' => 'Quality', |
||
158 | 'SoldOnBehalf.Nice' => 'On Behalf', |
||
159 | 'PurchasePrice' => 'Purchase Price', |
||
160 | 'Price' => 'Sale/Ticket Price', |
||
161 | 'SoldPrice' => 'Sold Price', |
||
162 | ); |
||
163 | |||
164 | private static $field_labels = array( |
||
165 | 'Title' => 'Title', |
||
166 | 'Price' => 'Sale Price', |
||
167 | 'InternalItemID' => 'Code', |
||
168 | 'PurchasePrice' => 'Purchase Price', |
||
169 | 'ProductQuality' => 'Quality', |
||
170 | 'IncludesBoxOrCase' => 'Includes', |
||
171 | 'OriginalManual' => 'Has Manual', |
||
172 | 'SerialNumber' => 'Serial Number' |
||
173 | ); |
||
174 | |||
175 | private static $searchable_fields = array( |
||
176 | 'Title' => 'PartialMatchFilter', |
||
177 | 'Price' => 'ExactMatchFilter', |
||
178 | 'InternalItemID' => 'PartialMatchFilter', |
||
179 | 'PurchasePrice' => 'ExactMatchFilter', |
||
180 | 'ProductQuality' => 'ExactMatchFilter', |
||
181 | 'IncludesBoxOrCase' => 'ExactMatchFilter', |
||
182 | 'OriginalManual' => 'ExactMatchFilter', |
||
183 | 'SerialNumber' => 'PartialMatchFilter' |
||
184 | ); |
||
185 | |||
186 | /** |
||
187 | * stadard SS method |
||
188 | * @return FieldList |
||
189 | */ |
||
190 | public function getCMSFields() |
||
224 | } |
||
225 |
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.