Total Complexity | 2 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class CustomerExtension extends DataExtension |
||
10 | { |
||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | private static $db = array( |
||
|
|||
15 | 'Customer_ID' => 'Int' |
||
16 | ); |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private static $has_many = array( |
||
22 | 'Orders' => Order::class, |
||
23 | ); |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private static $indexes = array( |
||
29 | 'Customer_ID' => true // make unique |
||
30 | ); |
||
31 | |||
32 | /** |
||
33 | * @throws \Psr\Container\NotFoundExceptionInterface |
||
34 | */ |
||
35 | public function onBeforeWrite() |
||
53 |