1 | <?php |
||
3 | class ImageGalleryEntry extends DataObject |
||
|
|||
4 | { |
||
5 | private static $singular_name = "Image Gallery Picture"; |
||
6 | |||
7 | private static $plural_name = "Image Gallery Pictures"; |
||
8 | |||
9 | private static $db = array( |
||
10 | "Title" => "Varchar(100)", |
||
11 | "Sort" => "Int" |
||
12 | ); |
||
13 | |||
14 | private static $has_one = array( |
||
15 | "Parent" => "SiteTree", |
||
16 | "Image" => "Image" |
||
17 | ); |
||
18 | |||
19 | private static $searchable_fields = array( |
||
20 | "Title" => "PartialMatchFilter" |
||
21 | ); |
||
22 | |||
23 | private static $summary_fields = array( |
||
24 | "Image.CMSThumbNail" => "Image", |
||
25 | "Title" => "Title" |
||
26 | ); |
||
27 | |||
28 | private static $field_labels = array( |
||
29 | "Sort" => "Sorting Index Number (lower numbers show first)" |
||
30 | ); |
||
31 | |||
32 | private static $casting = array( |
||
33 | "BestTitle" => "Varchar" |
||
34 | ); |
||
35 | |||
36 | //CRUD settings |
||
37 | |||
38 | private static $default_sort = "Sort ASC, Title ASC"; |
||
39 | |||
40 | private static $defaults = array( |
||
41 | "Sort" => 100 |
||
42 | ); |
||
43 | |||
44 | public function getBestTitle() |
||
58 | |||
59 | public function populateDefaults() |
||
64 | |||
65 | /** |
||
66 | * CMS Fields |
||
67 | * @return FieldList |
||
68 | */ |
||
69 | public function getCMSFields() |
||
76 | |||
77 | } |
||
78 |
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.