| 1 | <?php  | 
            ||
| 3 | class FriendEmail extends DataObject  | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 4 | { | 
            ||
| 5 | private static $db = array(  | 
            ||
| 6 | 'To' => 'Text',  | 
            ||
| 7 | 'Message' => 'Text',  | 
            ||
| 8 | 'From' => 'Text',  | 
            ||
| 9 | 'IPAddress' => 'Text'  | 
            ||
| 10 | );  | 
            ||
| 11 | |||
| 12 | private static $has_one = array(  | 
            ||
| 13 | 'Page' => 'Page'  | 
            ||
| 14 | );  | 
            ||
| 15 | |||
| 16 | private static $casting = array(  | 
            ||
| 17 | "ShortMessage" => "Varchar"  | 
            ||
| 18 | );  | 
            ||
| 19 | |||
| 20 | public function ShortMessage()  | 
            ||
| 28 | |||
| 29 | public function canCreate($member = null)  | 
            ||
| 33 | |||
| 34 | public function canEdit($member = null)  | 
            ||
| 38 | |||
| 39 | public function canDelete($member = null)  | 
            ||
| 43 | |||
| 44 |     private static $searchable_fields = array('To', 'Message', 'From', 'IPAddress', 'Page.Title'); | 
            ||
| 45 | |||
| 46 |     private static $summary_fields = array('Created', 'To', 'ShortMessage', 'From', 'IPAddress', 'Page.Title'); | 
            ||
| 47 | |||
| 48 | private static $singular_name = 'Message to Friend';  | 
            ||
| 49 | |||
| 50 | private static $plural_name = 'Messages to Friends';  | 
            ||
| 51 | |||
| 52 | private static $default_sort = 'Created DESC';  | 
            ||
| 53 | }  | 
            ||
| 54 | 
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.