1 | <?php |
||
3 | class CustomerImage extends DataObject |
||
|
|||
4 | { |
||
5 | private static $db = array( |
||
6 | 'Status' => "Enum('New,Approved,Declined,Example', 'New')", |
||
7 | 'FirstName' => 'Varchar', |
||
8 | 'Email' => 'Varchar(100)', |
||
9 | 'Surname' => 'Varchar', |
||
10 | 'Location' => 'Varchar(255)', |
||
11 | 'Feedback' => 'Text' |
||
12 | ); |
||
13 | |||
14 | private static $has_one = array( |
||
15 | 'ProductPage' => 'ProductPage', |
||
16 | 'ProductVariation' => 'ProductVariation', |
||
17 | 'Image1' => 'Image', |
||
18 | 'Image2' => 'Image', |
||
19 | 'Image3' => 'Image', |
||
20 | 'Image4' => 'Image', |
||
21 | 'Image5' => 'Image', |
||
22 | 'FinalImage' => 'Image' |
||
23 | ); |
||
24 | |||
25 | private static $default_sort = '"Created" DESC'; |
||
26 | |||
27 | private static $singular_name = 'Customer Image'; |
||
28 | |||
29 | private static $plural_name = 'Customer Images'; |
||
30 | |||
31 | private static $casting = array( |
||
32 | "Title" => "Varchar", |
||
33 | 'Thumbnail' => "HTMLText" |
||
34 | ); |
||
35 | |||
36 | private static $summary_fields = array( |
||
37 | "Thumbnail" => "Thumbnail", |
||
38 | "Status" => "Status", |
||
39 | "Location" => "Location" |
||
40 | ); |
||
41 | |||
42 | |||
43 | /** |
||
44 | * STANDARD SILVERSTRIPE STUFF |
||
45 | * @todo: how to translate this? |
||
46 | **/ |
||
47 | private static $searchable_fields = array( |
||
48 | 'Status', |
||
49 | 'FirstName' => 'PartialMatchFilter', |
||
50 | 'Surname' => 'PartialMatchFilter', |
||
51 | 'Location' => 'PartialMatchFilter', |
||
52 | 'ProductPageID' |
||
53 | ); |
||
54 | |||
55 | public function IsPortrait() |
||
61 | |||
62 | public function canView($member = null) |
||
69 | |||
70 | public function getCMSFields() |
||
98 | |||
99 | public function getThumbnail() |
||
112 | } |
||
113 | |||
124 |
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.