1 | <?php |
||
9 | class SmartChimpNewsletter extends DataObject |
||
|
|||
10 | { |
||
11 | public static $has_one = array( |
||
12 | "Parent" => "SmartChimpSignupPage" |
||
13 | ); |
||
14 | |||
15 | public static $db = array( |
||
16 | "Hide" => "Boolean", |
||
17 | "CampaignID" => "Varchar(30)",//id |
||
18 | "Date" => "Datetime",//send_time |
||
19 | "Title" => "Varchar(255)",//title |
||
20 | "Subject" => "Varchar(255)",//title |
||
21 | "PermaLink" => "Varchar(255)",//archive_url |
||
22 | "WebID" => "Int", //web_id |
||
23 | "Status" => "Varchar(20)", //should be sent! |
||
24 | "TextContent" => "Text", //html |
||
25 | "HTMLContent" => "HTMLText", //text |
||
26 | "Done" => "Boolean" |
||
27 | ); |
||
28 | |||
29 | |||
30 | |||
31 | public static $indexes = array( |
||
32 | "CampaignID" => true |
||
33 | ); |
||
34 | |||
35 | public static $casting = array( |
||
36 | "DateNice" => "Text", |
||
37 | "ShowOrHide" => "Text", |
||
38 | "YearMonth" => "Int", |
||
39 | "Month" => "Int", |
||
40 | "Link" => "Text" |
||
41 | ); |
||
42 | |||
43 | public function getYearMonth() |
||
47 | |||
48 | public function getDateNice() |
||
52 | |||
53 | public function ShowOrHide() |
||
57 | |||
58 | public function Link() |
||
62 | |||
63 | public function requiredDefaultRecords() |
||
67 | public static $default_sort = "\"Date\" DESC"; |
||
68 | public static $defaults = array();//use fieldName => Default Value |
||
69 | public static $searchable_fields = array("Title" => "PartialMatchFilter"); |
||
70 | public static $field_labels = array("Title" => "Title"); |
||
71 | public static $summary_fields = array("Title" => "Title", "DateNice" => "Date", "ShowOrHide" => "ShowOrHide"); |
||
72 | public static $singular_name = "MailChimp Newsletter"; |
||
73 | public static $plural_name = "MailChimp Newsletters"; |
||
74 | |||
75 | public static function clean_up_characters() |
||
85 | |||
86 | public static $field_types = array( |
||
87 | "CampaignID" => "TextField",//id |
||
88 | "Date" => "TextField",//send_time |
||
89 | "Title" => "TextField",//title |
||
90 | "Subject" => "TextField",//title |
||
91 | "PermaLink" => "TextField",//archive_url |
||
92 | "WebID" => "NumericField", //web_id |
||
93 | "Status" => "TextField", //should be sent! |
||
94 | "TextContent" => "TextareaField", //html |
||
95 | "HTMLContent" => "TextareaField", //text |
||
96 | "Done" => "CheckboxField" |
||
97 | ); |
||
98 | } |
||
99 |
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.