1 | <?php |
||
3 | class ContactUsFormEntry extends DataObject |
||
|
|||
4 | { |
||
5 | |||
6 | private static $db = array( |
||
7 | 'AdminEmail' => 'Varchar(255)', |
||
8 | 'Email' => 'Varchar(255)', |
||
9 | 'FirstName' => 'Varchar(255)', |
||
10 | 'Surname' => 'Varchar(255)', |
||
11 | 'Phone' => 'Varchar(255)', |
||
12 | 'Enquiry' => 'Text', |
||
13 | 'Data' => 'Text', |
||
14 | 'Responded' => 'Boolean', |
||
15 | 'SentToAdmin' => 'Boolean', |
||
16 | 'SentToCustomer' => 'Boolean' |
||
17 | ); |
||
18 | |||
19 | private static $has_one = array( |
||
20 | 'Page' => 'SiteTree' |
||
21 | ); |
||
22 | |||
23 | private static $casting = array( |
||
24 | 'NiceData' => 'HTMLText' |
||
25 | ); |
||
26 | |||
27 | public static function create_enquiry($sqlSafeData, $page) |
||
53 | |||
54 | private static $singular_name = "Customer Enquiry"; |
||
55 | function i18n_singular_name() { return self::$singular_name;} |
||
56 | |||
57 | private static $plural_name = "Customer Enquiries"; |
||
58 | function i18n_plural_name() { return self::$plural_name;} |
||
59 | |||
60 | private static $indexes = array( |
||
61 | "Email" => true |
||
62 | ); |
||
63 | |||
64 | private static $default_sort = array( |
||
65 | 'Created' => 'Desc' |
||
66 | ); |
||
67 | |||
68 | private static $summary_fields = array( |
||
69 | 'Email' => 'From', |
||
70 | 'AdminEmail' => 'To', |
||
71 | 'Created' => 'Created', |
||
72 | 'SentToAdmin.Nice' => 'Sent to Admin', |
||
73 | 'SentToCustomer.Nice' => 'Sent to Customer', |
||
74 | 'Enquiry' => 'Enquiry', |
||
75 | 'Responded.Nice' => 'Replied', |
||
76 | 'Page.Title' => 'Page' |
||
77 | ); |
||
78 | |||
79 | private static $field_labes = array( |
||
80 | 'Email' => 'From', |
||
81 | 'AdminEmail' => 'To' |
||
82 | ); |
||
83 | |||
84 | public function canCreate($member = null) { |
||
87 | |||
88 | public function canDelete($member = null) { |
||
91 | |||
92 | public function getCMSFields() |
||
121 | |||
122 | /** |
||
123 | * returns list of fields as they are exported |
||
124 | * @return array |
||
125 | * Field => Label |
||
126 | */ |
||
127 | // public function getExportFields(); |
||
128 | |||
129 | function getNiceData() |
||
142 | |||
143 | } |
||
144 |
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.