1 | <?php |
||
3 | class Affiliation extends DataObject |
||
|
|||
4 | { |
||
5 | public static $db = array( |
||
6 | "Title" => "Varchar(100)", |
||
7 | "Code" => "Varchar(100)", |
||
8 | "Link" => "Varchar(100)", |
||
9 | "Sort" => "Int" |
||
10 | ); |
||
11 | |||
12 | public static $has_one = array( |
||
13 | "Parent" => "SiteTree", |
||
14 | "Logo" => "Image" |
||
15 | ); |
||
16 | |||
17 | public static function get_has_many_complex_table_field($controller, $name) |
||
30 | |||
31 | public function getCode() |
||
38 | |||
39 | public static $searchable_fields = array( |
||
40 | "Title" => "PartialMatchFilter", |
||
41 | "Code" => "PartialMatchFilter", |
||
42 | "Link" => "PartialMatchFilter" |
||
43 | ); |
||
44 | |||
45 | public static $summary_fields = array( |
||
46 | "Title" => "Title", |
||
47 | "Code" => "Code", |
||
48 | "Link" => "Link" |
||
49 | ); |
||
50 | |||
51 | public static $field_labels = array( |
||
52 | "Sort" => "Sorting Index Number (lower numbers show first)" |
||
53 | ); |
||
54 | |||
55 | public static $singular_name = "Affiliation"; |
||
56 | |||
57 | public static $plural_name = "Affiliations"; |
||
58 | //CRUD settings |
||
59 | |||
60 | public static $default_sort = "Sort ASC, Title ASC"; |
||
61 | |||
62 | public static $defaults = array( |
||
63 | "Sort" => 100 |
||
64 | ); |
||
65 | |||
66 | public function populateDefaults() |
||
71 | } |
||
72 |
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.