1 | <?php |
||
9 | class OrderStatusLog extends DataObject |
||
10 | { |
||
11 | private static $db = array( |
||
|
|||
12 | 'Title' => 'Varchar(100)', |
||
13 | 'Note' => 'Text', |
||
14 | 'DispatchedBy' => 'Varchar(100)', |
||
15 | 'DispatchedOn' => 'Date', |
||
16 | 'DispatchTicket' => 'Varchar(100)', |
||
17 | 'PaymentCode' => 'Varchar(100)', |
||
18 | 'PaymentOK' => 'Boolean', |
||
19 | 'SentToCustomer' => 'Boolean', |
||
20 | ); |
||
21 | |||
22 | private static $has_one = array( |
||
23 | 'Author' => 'Member', |
||
24 | 'Order' => 'Order', |
||
25 | ); |
||
26 | |||
27 | private static $searchable_fields = array( |
||
28 | "Note" => "PartialMatchFilter", |
||
29 | 'DispatchTicket' => 'PartialMatchFilter', |
||
30 | 'PaymentCode' => 'PartialMatchFilter', |
||
31 | 'PaymentOK', |
||
32 | ); |
||
33 | |||
34 | private static $summary_fields = array( |
||
35 | "Created" => "Date", |
||
36 | "OrderID" => "OrderID", |
||
37 | "Title" => "Title", |
||
38 | "SentToCustomer" => "SentToCustomer", |
||
39 | ); |
||
40 | |||
41 | private static $field_labels = array( |
||
42 | "SentToCustomer" => "Send this update as a message to the customer", |
||
43 | ); |
||
44 | |||
45 | private static $singular_name = "Order Log Entry"; |
||
46 | |||
47 | private static $plural_name = "Order Status Log Entries"; |
||
48 | |||
49 | private static $default_sort = "\"Created\" DESC"; |
||
50 | |||
51 | public function canDelete($member = null) |
||
55 | |||
56 | public function canEdit($member = null) |
||
60 | |||
61 | 5 | public function populateDefaults() |
|
66 | |||
67 | 1 | public function onBeforeWrite() |
|
77 | |||
78 | 1 | public function validate() |
|
86 | |||
87 | 1 | public function onAfterWrite() |
|
93 | |||
94 | 5 | protected function updateWithLastInfo() |
|
108 | } |
||
109 |