1 | <?php |
||
17 | class Location extends DataObject implements PermissionProvider |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private static $db = array( |
||
24 | 'Title' => 'Varchar(255)', |
||
25 | 'Featured' => 'Boolean', |
||
26 | 'Website' => 'Varchar(255)', |
||
27 | 'Phone' => 'Varchar(40)', |
||
28 | 'Email' => 'Varchar(255)', |
||
29 | 'EmailAddress' => 'Varchar(255)', |
||
30 | 'ShowInLocator' => 'Boolean', |
||
31 | 'Import_ID' => 'Int', |
||
32 | ); |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private static $has_one = array( |
||
38 | 'Category' => 'LocationCategory', |
||
39 | ); |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | private static $casting = array( |
||
45 | 'distance' => 'Decimal(9,3)', |
||
46 | ); |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | private static $default_sort = 'Title'; |
||
|
|||
52 | |||
53 | /** |
||
54 | * @var array |
||
55 | */ |
||
56 | private static $defaults = array( |
||
57 | 'ShowInLocator' => true, |
||
58 | ); |
||
59 | |||
60 | /** |
||
61 | * @var string |
||
62 | */ |
||
63 | private static $singular_name = 'Location'; |
||
64 | /** |
||
65 | * @var string |
||
66 | */ |
||
67 | private static $plural_name = 'Locations'; |
||
68 | |||
69 | /** |
||
70 | * api access via Restful Server module |
||
71 | * |
||
72 | * @var bool |
||
73 | */ |
||
74 | private static $api_access = true; |
||
75 | |||
76 | /** |
||
77 | * search fields for Model Admin |
||
78 | * |
||
79 | * @var array |
||
80 | */ |
||
81 | private static $searchable_fields = array( |
||
82 | 'Title', |
||
83 | 'Address', |
||
84 | 'Suburb', |
||
85 | 'State', |
||
86 | 'Postcode', |
||
87 | 'Country', |
||
88 | 'Website', |
||
89 | 'Phone', |
||
90 | 'Email', |
||
91 | 'Category.ID', |
||
92 | 'Featured', |
||
93 | ); |
||
94 | |||
95 | /** |
||
96 | * columns for grid field |
||
97 | * |
||
98 | * @var array |
||
99 | */ |
||
100 | private static $summary_fields = array( |
||
101 | 'Title', |
||
102 | 'Address', |
||
103 | 'Suburb', |
||
104 | 'State', |
||
105 | 'Postcode', |
||
106 | 'Country', |
||
107 | 'Category.Name', |
||
108 | 'Featured.NiceAsBoolean', |
||
109 | 'Coords', |
||
110 | ); |
||
111 | |||
112 | /** |
||
113 | * @var array |
||
114 | */ |
||
115 | private static $extensions = [ |
||
116 | 'Heyday\VersionedDataObjects\VersionedDataObject', |
||
117 | ]; |
||
118 | |||
119 | /** |
||
120 | * Coords status for $summary_fields |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | 1 | public function getCoords() |
|
128 | |||
129 | /** |
||
130 | * custom labels for fields |
||
131 | * |
||
132 | * @param bool $includerelations |
||
133 | * @return array|string |
||
134 | */ |
||
135 | 1 | public function fieldLabels($includerelations = true) |
|
153 | |||
154 | /** |
||
155 | * @return FieldList |
||
156 | */ |
||
157 | 1 | public function getCMSFields() |
|
191 | |||
192 | /** |
||
193 | * @return ValidationResult |
||
194 | */ |
||
195 | 3 | public function validate() |
|
201 | |||
202 | /** |
||
203 | * @return bool|string |
||
204 | */ |
||
205 | public function EmailAddress() |
||
216 | |||
217 | /** |
||
218 | * @param null|Member $member |
||
219 | * |
||
220 | * @return bool |
||
221 | */ |
||
222 | 1 | public function canView($member = null) |
|
226 | |||
227 | /** |
||
228 | * @param null|Member $member |
||
229 | * @return bool|int |
||
230 | */ |
||
231 | 1 | public function canEdit($member = null) |
|
235 | |||
236 | /** |
||
237 | * @param null|Member $member |
||
238 | * @return bool|int |
||
239 | */ |
||
240 | 1 | public function canDelete($member = null) |
|
244 | |||
245 | /** |
||
246 | * @param null|Member $member |
||
247 | * @return bool|int |
||
248 | */ |
||
249 | 1 | public function canCreate($member = null) |
|
253 | |||
254 | /** |
||
255 | * @return array |
||
256 | */ |
||
257 | 1 | public function providePermissions() |
|
265 | |||
266 | } |
||
267 |
This check marks private properties in classes that are never used. Those properties can be removed.