Code Duplication    Length = 3-3 lines in 2 locations

code/extensions/SiteConfigSubsites.php 1 location

@@ 46-48 (lines=3) @@
43
44
    public function onBeforeWrite()
45
    {
46
        if ((!is_numeric($this->owner->ID) || !$this->owner->ID) && !$this->owner->SubsiteID) {
47
            $this->owner->SubsiteID = Subsite::currentSubsiteID();
48
        }
49
    }
50
51
    /**

code/extensions/SiteTreeSubsites.php 1 location

@@ 66-68 (lines=3) @@
63
    
64
    public function onBeforeWrite()
65
    {
66
        if (!$this->owner->ID && !$this->owner->SubsiteID) {
67
            $this->owner->SubsiteID = Subsite::currentSubsiteID();
68
        }
69
        
70
        parent::onBeforeWrite();
71
    }