1 | <?php |
||
7 | class SubsiteDomain extends DataObject |
||
8 | { |
||
9 | /** |
||
10 | * |
||
11 | * @var array |
||
12 | */ |
||
13 | private static $db = array( |
||
|
|||
14 | "Domain" => "Varchar(255)", |
||
15 | "IsPrimary" => "Boolean", |
||
16 | ); |
||
17 | |||
18 | /** |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | private static $has_one = array( |
||
23 | "Subsite" => "Subsite", |
||
24 | ); |
||
25 | |||
26 | /** |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | private static $summary_fields=array( |
||
31 | 'Domain', |
||
32 | 'IsPrimary', |
||
33 | ); |
||
34 | |||
35 | /** |
||
36 | * Whenever a Subsite Domain is written, rewrite the hostmap |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | public function onAfterWrite() |
||
44 | |||
45 | /** |
||
46 | * |
||
47 | * @return \FieldList |
||
48 | */ |
||
49 | public function getCMSFields() |
||
59 | |||
60 | /** |
||
61 | * |
||
62 | * @param bool $includerelations |
||
63 | * @return array |
||
64 | */ |
||
65 | public function fieldLabels($includerelations = true) |
||
73 | |||
74 | /** |
||
75 | * Before writing the Subsite Domain, strip out any HTML the user has entered. |
||
76 | * @return void |
||
77 | */ |
||
78 | public function onBeforeWrite() |
||
85 | } |
||
86 |