1 | <?php |
||
23 | class CatalogProduct extends DataObject implements PermissionProvider, ViewableDataObjectInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private static $singular_name = 'Product'; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private static $plural_name = 'Products'; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private static $db = array( |
||
39 | 'Title' => 'Varchar(255)', |
||
40 | 'Content' => 'HTMLText', |
||
41 | 'QuickFeatures' => 'HTMLText', |
||
42 | 'Dimensions' => 'Varchar(255)', |
||
43 | 'SKU' => 'Varchar(50)', |
||
44 | ); |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | private static $many_many = array( |
||
50 | 'Categories' => CatalogCategory::class, |
||
51 | 'CareCleaningDocs' => CareCleaningDoc::class, |
||
52 | 'OperationManuals' => OperationManual::class, |
||
53 | 'SpecSheets' => SpecSheet::class, |
||
54 | 'Warranties' => Warranty::class, |
||
55 | ); |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | private static $many_many_extraFields = array( |
||
61 | 'Categories' => array( |
||
62 | 'SortOrder' => 'Int', |
||
63 | ), |
||
64 | 'CareCleaningDocs' => array( |
||
65 | 'Sort' => 'Int', |
||
66 | ), |
||
67 | 'OperationManuals' => array( |
||
68 | 'Sort' => 'Int', |
||
69 | ), |
||
70 | 'SpecSheets' => array( |
||
71 | 'Sort' => 'Int', |
||
72 | ), |
||
73 | 'Warranties' => array( |
||
74 | 'Sort' => 'Int', |
||
75 | ), |
||
76 | ); |
||
77 | |||
78 | /** |
||
79 | * @var string |
||
80 | */ |
||
81 | private static $table_name = 'CatalogProdcut'; |
||
|
|||
82 | |||
83 | /** |
||
84 | * @var array |
||
85 | */ |
||
86 | private static $summary_fields = array( |
||
87 | 'ProductThumbnail' => 'Image', |
||
88 | 'Title' => 'Title', |
||
89 | 'Type' => 'Type', |
||
90 | 'CategoryList' => 'Categories', |
||
91 | 2 | ); |
|
92 | |||
93 | 2 | /** |
|
94 | * @var array |
||
95 | 2 | */ |
|
96 | 2 | private static $searchable_fields = array( |
|
97 | 'Title' => array( |
||
98 | 2 | 'title' => 'Product Name', |
|
99 | ), |
||
100 | 'Categories.ID' => array( |
||
101 | 'title' => 'Category', |
||
102 | ), |
||
103 | ); |
||
104 | 1 | ||
105 | /** |
||
106 | 1 | * @param bool $includerelations |
|
107 | * @return array|string |
||
108 | 1 | */ |
|
109 | 1 | public function fieldLabels($includerelations = true) |
|
118 | |||
119 | /** |
||
120 | * @return string |
||
121 | */ |
||
122 | public function CategoryList() |
||
137 | |||
138 | /** |
||
139 | * @return mixed |
||
140 | */ |
||
141 | public function getImage() |
||
151 | |||
152 | /** |
||
153 | * @return mixed |
||
154 | */ |
||
155 | public function Image() |
||
159 | |||
160 | 1 | /** |
|
161 | * @return mixed |
||
162 | */ |
||
163 | 1 | public function ProductThumbnail() |
|
172 | 1 | ||
173 | 1 | /** |
|
174 | * @return FieldList |
||
175 | 1 | */ |
|
176 | public function getCMSFields() |
||
262 | |||
263 | 1 | /** |
|
264 | * @return CatalogCategory |
||
265 | 1 | */ |
|
266 | public function getPrimaryCategory() |
||
275 | 1 | ||
276 | /** |
||
277 | * set ParentPage for ViewableDataobject |
||
278 | * |
||
279 | * @return string |
||
280 | */ |
||
281 | public function getParentPage() |
||
285 | |||
286 | /** |
||
287 | * set ViewAction for ViewableDataobject |
||
288 | * |
||
289 | * @return string |
||
290 | */ |
||
291 | 1 | public function getViewAction() |
|
295 | 1 | ||
296 | 1 | /** |
|
297 | 1 | * @return \SilverStripe\ORM\DataList |
|
298 | */ |
||
299 | public function getAncestors() |
||
303 | |||
304 | /** |
||
305 | 1 | * @return array |
|
306 | */ |
||
307 | 1 | public function providePermissions() |
|
315 | 1 | ||
316 | /** |
||
317 | 1 | * @param null $member |
|
318 | * |
||
319 | * @return bool|int |
||
320 | */ |
||
321 | public function canEdit($member = null, $context = []) |
||
325 | 1 | ||
326 | /** |
||
327 | 1 | * @param null $member |
|
328 | * |
||
329 | * @return bool|int |
||
330 | */ |
||
331 | public function canDelete($member = null, $context = []) |
||
335 | 1 | ||
336 | /** |
||
337 | 1 | * @param null $member |
|
338 | * |
||
339 | * @return bool|int |
||
340 | */ |
||
341 | public function canCreate($member = null, $context = []) |
||
345 | |||
346 | /** |
||
347 | * @param null $member |
||
348 | * |
||
349 | 1 | * @return bool |
|
350 | */ |
||
351 | public function canView($member = null, $context = []) |
||
355 | |||
356 | public function allowedChildren() |
||
360 | } |
This check marks private properties in classes that are never used. Those properties can be removed.