1 | <?php |
||
3 | class DMSDocumentCartSubmission extends DataObject |
||
|
|||
4 | { |
||
5 | private static $db = array( |
||
6 | 'ReceiverName' => 'Varchar(100)', |
||
7 | 'ReceiverPhone' => 'Varchar(20)', |
||
8 | 'ReceiverEmail' => 'Varchar(254)', |
||
9 | 'DeliveryAddressLine1' => 'Varchar(200)', |
||
10 | 'DeliveryAddressLine2' => 'Varchar(200)', |
||
11 | 'DeliveryAddressCountry' => 'Varchar(50)', |
||
12 | 'DeliveryAddressPostCode' => 'Varchar(20)', |
||
13 | 'CreatedAt' => 'Datetime', |
||
14 | ); |
||
15 | |||
16 | private static $has_many = array( |
||
17 | 'Items' => 'DMSDocumentCartSubmissionItem', |
||
18 | ); |
||
19 | |||
20 | private static $summary_fields = array( |
||
21 | 'ReceiverName' => 'Receiver Name', |
||
22 | 'ReceiverPhone' => 'Receiver Phone', |
||
23 | 'ReceiverEmail' => 'Receiver Email', |
||
24 | 'Items.Count' => 'No. Items', |
||
25 | 'CreatedAt.Nice' => 'Created At' |
||
26 | ); |
||
27 | |||
28 | private static $singular_name = 'Cart Submission'; |
||
29 | private static $plural_name = 'Cart Submissions'; |
||
30 | |||
31 | /** |
||
32 | * Removing the add and existing GridField components to ensure that the model admin for submissions doesn't |
||
33 | * let you add new records |
||
34 | * |
||
35 | * @return FieldList |
||
36 | */ |
||
37 | public function getCMSFields() |
||
56 | |||
57 | /** |
||
58 | * Set the created at datetime if it hasn't been set already |
||
59 | */ |
||
60 | public function onBeforeWrite() |
||
67 | } |
||
68 |
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.