1 | <?php |
||
10 | class CampaignMonitorCustomField extends DataObject |
||
|
|||
11 | { |
||
12 | private static $db = array( |
||
13 | "Code" => "Varchar(64)", |
||
14 | "Title" => "Varchar(64)", |
||
15 | "Type" => "Varchar(32)", |
||
16 | "Options" => "Text", |
||
17 | "Visible" => "Boolean", |
||
18 | "ListID" => "Varchar(32)" |
||
19 | ); |
||
20 | |||
21 | private static $casting = array( |
||
22 | "Key" => "Varchar" |
||
23 | ); |
||
24 | |||
25 | private static $summary_fields = array( |
||
26 | "Title" => "Title", |
||
27 | "Visible.Nice" => "Visible" |
||
28 | ); |
||
29 | |||
30 | private static $indexes = array( |
||
31 | "ListID" => true, |
||
32 | "Code" => true |
||
33 | ); |
||
34 | |||
35 | private static $has_one = array( |
||
36 | "CampaignMonitorSignupPage" => "CampaignMonitorSignupPage" |
||
37 | ); |
||
38 | |||
39 | private static $default_sort = array( |
||
40 | "Visible" => "DESC" |
||
41 | ); |
||
42 | |||
43 | /** |
||
44 | * form field matcher between CM and SS CMField => SSField |
||
45 | * @return array |
||
46 | */ |
||
47 | private static $field_translator = array( |
||
48 | "MultiSelectOne" => "OptionSetField", |
||
49 | "Text" => "TextField", |
||
50 | "Number" => "NumericField", |
||
51 | "MultiSelectMany" => "CheckboxSetField", |
||
52 | "Date" => "DateField" |
||
53 | ); |
||
54 | |||
55 | |||
56 | public function canCreate($member = null) |
||
60 | |||
61 | public function canDelete($member = null) |
||
65 | |||
66 | public function canEdit($member = null) |
||
70 | |||
71 | public function onBeforeWrite() |
||
76 | |||
77 | public function getKey() |
||
81 | |||
82 | public function getOptionsAsArray() |
||
86 | |||
87 | /** |
||
88 | * |
||
89 | * @return CampaignMonitorCustomField |
||
90 | */ |
||
91 | public static function create_from_campaign_monitor_object($customFieldsObject, $listID) |
||
114 | |||
115 | private static function key_to_code($key) |
||
119 | |||
120 | /** |
||
121 | * @var array |
||
122 | */ |
||
123 | private $_fieldTranslator = array(); |
||
124 | |||
125 | /** |
||
126 | * @param string $namePrefix |
||
127 | * @param string $nameAppendix |
||
128 | * @param string $title |
||
129 | * @param null | array $options |
||
130 | */ |
||
131 | public function getFormField($namePrefix = "", $nameAppendix = "", $title = "", $options = null) |
||
152 | } |
||
153 |
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.