Version: current

     1 <?php
     2
     3 class SubsiteDomain extends DataObject {
     4     static $db = array(
     5         "Domain" => "Varchar(255)",
     6         "IsPrimary" => "Boolean",
     7     );
     8     static $has_one = array(
     9         "Subsite" => "Subsite",
    10     );
    11
    12     /**
    13      * Whenever a Subsite Domain is written, rewrite the hostmap
    14      *
    15      * @return void
    16      */
    17     public function onAfterWrite() {
    18         Subsite::writeHostMap();
    19     }
    20 }

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -