1 | <?php |
||
13 | class PageSectionObject extends DataObject |
||
14 | { |
||
15 | /** |
||
16 | * @return string |
||
17 | */ |
||
18 | private static $singular_name = 'Page Section'; |
||
19 | |||
20 | /** |
||
21 | * @return string |
||
22 | */ |
||
23 | private static $plural_name = 'Page Sections'; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private static $db = array( |
||
29 | 'Name' => 'Varchar(255)', |
||
30 | 'Title' => 'Varchar(255)', |
||
31 | 'Content' => 'HTMLText', |
||
32 | 'SortOrder' => 'Int', |
||
33 | ); |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private static $has_one = array( |
||
39 | 'Image' => 'Image', |
||
40 | 'PageSectionBlock' => 'PageSectionBlock', |
||
41 | ); |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private static $default_sort = 'Name ASC'; |
||
|
|||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | */ |
||
51 | private static $summary_fields = array( |
||
52 | 'Image.CMSThumbnail' => 'Image', |
||
53 | 'Name' => 'Name', |
||
54 | 'Title' => 'Title', |
||
55 | ); |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | private static $searchable_fields = array( |
||
61 | 'Name' => 'Name', |
||
62 | 'Title' => 'Title', |
||
63 | ); |
||
64 | |||
65 | /** |
||
66 | * @return FieldList |
||
67 | */ |
||
68 | public function getCMSFields() |
||
85 | |||
86 | /** |
||
87 | * @return ValidationResult |
||
88 | */ |
||
89 | public function validate() |
||
99 | |||
100 | /** |
||
101 | * Set permissions, allow all users to access by default. |
||
102 | * Override in descendant classes, or use PermissionProvider. |
||
103 | */ |
||
104 | |||
105 | /** |
||
106 | * @param null $member |
||
107 | * |
||
108 | * @return bool |
||
109 | */ |
||
110 | public function canCreate($member = null) |
||
114 | |||
115 | /** |
||
116 | * @param null $member |
||
117 | * |
||
118 | * @return bool |
||
119 | */ |
||
120 | public function canView($member = null) |
||
124 | |||
125 | /** |
||
126 | * @param null $member |
||
127 | * |
||
128 | * @return bool |
||
129 | */ |
||
130 | public function canEdit($member = null) |
||
134 | |||
135 | /** |
||
136 | * @param null $member |
||
137 | * |
||
138 | * @return bool |
||
139 | */ |
||
140 | public function canDelete($member = null) |
||
144 | } |
This check marks private properties in classes that are never used. Those properties can be removed.