1 | <?php |
||
9 | class StaffProfile extends DataObject |
||
|
|||
10 | { |
||
11 | private static $db = array( |
||
12 | "Name" => "Varchar(255)", |
||
13 | "Position" => "Varchar(255)", |
||
14 | "Description" => "Text", |
||
15 | "Email" => "Varchar(255)", |
||
16 | "SubjectLine" => "Varchar(255)", |
||
17 | "Sort" => "Int" |
||
18 | ); |
||
19 | |||
20 | private static $has_one = array( |
||
21 | "ProfilePicture" => "Image", |
||
22 | "Parent" => "StaffProfilesPage" |
||
23 | ); |
||
24 | |||
25 | //database related settings |
||
26 | private static $indexes = array( |
||
27 | "Sort" => true |
||
28 | ); |
||
29 | |||
30 | //formatting |
||
31 | private static $searchable_fields = array("Name" => "PartialMatchFilter"); |
||
32 | |||
33 | private static $field_labels = array( |
||
34 | "SortNumber" => "Sort Index Number for Sorting (lower numbers first)", |
||
35 | "Subjectline" => "Optional Subject Line" |
||
36 | ); |
||
37 | |||
38 | private static $summary_fields = array("Name" => "Name", "Email" => "Email", "Title" => "Title"); |
||
39 | |||
40 | private static $singular_name = "Staff Profile"; |
||
41 | |||
42 | private static $plural_name = "Staff Profiles"; |
||
43 | |||
44 | private static $default_sort = "Sort ASC, Name ASC"; |
||
45 | |||
46 | private static $defaults = array( |
||
47 | "Sort" => 100 |
||
48 | ); |
||
49 | |||
50 | /** |
||
51 | * replacement placeholders |
||
52 | * [xxx] => yyy |
||
53 | * where xxx is the string the CMS user types |
||
54 | * and yyy the replacement field / relation. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | private static $subject_place_holders = array( |
||
59 | "Name" => "Name", |
||
60 | "Email" => "Email", |
||
61 | "Position" => "Position", |
||
62 | "PageTitle" => "Parent.Title", |
||
63 | "PageLink" => "Parent.Link" |
||
64 | ); |
||
65 | |||
66 | public function populateDefaults() |
||
71 | |||
72 | public function getCMSFields() |
||
88 | |||
89 | public function fieldLabels($includeRelations = true) |
||
94 | |||
95 | /** |
||
96 | * Obscure all email links in StringField. |
||
97 | * Matches mailto:[email protected] as well as [email protected] |
||
98 | * |
||
99 | * @return string | Null |
||
100 | */ |
||
101 | public function EncodedEmailLink() |
||
112 | |||
113 | /** |
||
114 | * Obscure all email links in StringField. |
||
115 | * Matches mailto:[email protected] as well as [email protected] |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | public function EncodedEmailText() |
||
130 | |||
131 | public function onBeforeWrite() |
||
142 | |||
143 | /** |
||
144 | * puts together a subject line with replacements |
||
145 | * |
||
146 | * @return String |
||
147 | */ |
||
148 | protected function SubjectLineCreator() |
||
182 | |||
183 | |||
184 | /** |
||
185 | * @var EmailObject |
||
186 | */ |
||
187 | protected $emailObject = null; |
||
188 | |||
189 | /** |
||
190 | * |
||
191 | * @return EmailObject | NULL |
||
192 | */ |
||
193 | protected function retrieveEmailObject() |
||
206 | |||
207 | /** |
||
208 | * finds the best email available. |
||
209 | * |
||
210 | * @return String |
||
211 | */ |
||
212 | protected function getBestEmail() |
||
221 | } |
||
222 |
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.